The full account of this lifetime is told in the Maha-Ummagga Jataka (#546), while the Kakantaka Jataka only relates this single incident from that story.
The Bodhisatta was once a king’s advisor. One day, while King Vedeha and the Bodhisatta were walking in the royal park, a chameleon came and lay down in front of the king. The Bodhisatta told the king it was paying respect. Pleased by this, the king ordered one of his men to deliver meat to the chameleon every day, and he did. One holy day (when no killing is allowed), the man could not buy any meat, so he drilled a hole in a half-anna coin and hung it around the chameleon’s neck. This made the creature feel so proud and rich that he did not come and bow the next time he saw the king. The king asked the Bodhisatta what was in the chameleon’s mind, and he explained it. The king sent for the man who delivered the meat and he confirmed that the Bodhisatta was right. Impressed, he gave the Bodhisatta the tax revenue earned at the four city gates. And, angry at the chameleon, the king wanted to stop sending meat, but the Bodhisatta told him it was unfitting of a king to break a promise.
In the Lifetime of the Buddha
One day some of the Buddha’s disciples were discussing his supreme wisdom; in particular, how he had humbled and converted a vast multitude of brahmins, ascetics, thieves, goblins, gods, and more. When the Buddha heard them talking about it, he told them this story so they knew that he’d also had perfect knowledge in the past.
King Vedeha was an earlier birth of Laludayi, an elder disciple of the Buddha who was so shy that he could not speak when around more than a single other person, and he often said one thing when he meant another.