PDA

View Full Version : change id on the fly?



Radziu
24 Feb 2009, 12:00 AM
in my app i create an objects with unique id's. New id for eg. new_fieldName after save form i destroy it and change form (objects) id's to uniqueNumber_fieldName. User without closing this form (in fact window with form) can open new form to create new event etc. but this destroying object and creating it once again is a little bit slow. Is it possible to change id of the object "on the fly"?
i tried to change options of the object by obj.id = newId but by Ext.getCmp('newId') obj i undefined

mjlecomte
24 Feb 2009, 5:51 AM
You can't simply reassign the id, as you noticed there are other issues like fixing the id that is stored in the MixedCollection.

I don't see why you require changing the id.

Radziu
24 Feb 2009, 5:57 AM
every object in my db has own id and sub_id when i open a lot of windows i have to check by the windowmgr that window with this id isn't opened. In fact every object in form has thesame prefix what the main object so i can use Ext.getCmp to have access to every object. The ids are create by external file (PHP file). So, to sum up when i save new form i have to reconfigure it to make old form :) with unique id from the db

mjlecomte
24 Feb 2009, 6:06 AM
I don't understand it enough to even suggest something. Perhaps posting some code would help (a small working showcase / proof of concept).