tree - Extjs 4 set each item an id -


so i'm working new ext following mvc patterns creating controllers listen view events fire methods. have view tree loaded admin menu , want listen 'users' controller when tree item called 'list users' clicked can show grid users. logic says have set id each tree element in order make sure i'm listening right , possible one...problem is, though send , id json on each element, never gets assigned. element ids still have 'ext-gen1091' type of element ids.

any idea how do assigning unique id each of tree elements?

my json looks this:

{"expanded":"true","text":"users","id":"users","children":[{"text":"list users","id":"userslist".... 

you don't need use html ids identify record handling. extjs provides apis make easy handle operations, listen events etc on tree or other components.

since, have id assigned each node in tree. can use same id work upon when action / event occurs. have add appropriate event listener methods tree panel. example if tracking click on node can make use of itemclick. methods parameters provide access information need.

here skeleton code:

itemclick: function(ext.view.view this, ext.data.model record, htmlelement item, number index, ext.eventobject e) {    // access record using record or can access html using item variable. } 

similarly can make use of other events , track user actions.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -