Cgridview Not Updating Script After Inserting New Record

I use a CGRIDVIEW, with an ajax call to a modal form for update every record. I also use a modal form to insert records.

This is my ajax for the update button:

For existing records (records that render when the grid load) everything work fine. The update button opens the form and everything is ok. The problem is after creating a new record via the modal form, saving it, and then calling yiiGridView.update for update. The grid updates fine, but when i press the update button on this newly inserted record, the ajax call doest work.

After looking around i found that there is no entry generated in the script for the record added…

Any ideas?

Thank you.