Forms isolation and components traversing
January 8th, 2009
I've write of this problem at the end of this post
http://extjs.com/forum/showthread.php?p=126765#post126765
I think that isolation and incapsulation of Exts objects is important, that will make it easy to handle datasets.
This thing is also related with components traversing, in some case where there isn't an easy way to find an object inside another object. Like to find parents, siblings, childrens and so on.
The find or findById methods will often fails, or I don't understand how do they work.
Like toolbars that do not offer any method to find buttons and elements inside of them. At least it seems so from the documentation.
Maybe my approach is wrong but as I can load a dataset in a grid without to worry about fields names, I mean that I don't have to worry if any other grid in the page use a dataset with equal fields names, the same I would do with data loaded inside forms.
But my tests say that with forms is necessary to use a prefix to give to any field a unique id. Otherwise if the page have 2 forms with the same fields ids is impossible to know where data will be loaded.
Using dataIndex forms are really isolated and do not conflict each other. Maybe you should add some explaination in the field API docs for dataIndex.That property isn't mentioned in the documentation and for me has been very important to manage this situation.
I understand how it works, I've also read the code of BasicForm and MixedCollection, but somehow it fails.
Also if findField iterates the items collection, if I have 2 forms in the same page where fields have the same ids, loadRecord or setValues fails to load data in the right form.
It seems that they load data in the first field they find in the DOM that have this id/name/dataIndex. Also if I've tested it just with ids.
They do not isolate the form from other forms. From the code I've read it seems they should operate inside the items collection with no relation with the DOM, but for some reason also other forms could be affected.
I would like to know if someone else have experienced the same issue or there is something wrong in my code that makes it happend. Just to understand if is a bug, because from the code I've read it seems that you have designed forms to be properly isolated.
#If you have any other info about this subject , Please add it free.# |
Posted in freedeadaim.com | edit
A little something about you, the author. Nothing lengthy, just an overview.