sanjay_1985
4 Feb 2014, 5:53 AM
Hi All,
I have given my XML and code read the XML below.
My requirement is, how do i print all 'components' if give "XXXUpdate" as input? Can someone help me with this?
<access>
<total>1</total>
<success>true</success>
<menus name="XXX">
<Permission name="XXXUpdate">
<component name="Save">savebuttonid</component>
<component name="add">addbuttonid</component>
<component name="accesscode">accesscode button id</component>
</Permission>
<Permission name="XXXRestore">
<component name="restore">restorebuttonid</component>
</Permission>
</menus>
</access>
Ext.define('User', {
extend: 'Ext.data.Model',
fields: ['Permission','component']
});
var store = Ext.create('Ext.data.Store', {
model: 'User',
autoLoad:true,
proxy: {
type: 'ajax',
url : 'Test2.xml',
reader: {
type : 'xml',
model: 'User',
record: 'menus',
root: 'access'
}
}, listeners:{
load:function(store, recs, successful, eOpts) {
//print records here
}
}
});
I have given my XML and code read the XML below.
My requirement is, how do i print all 'components' if give "XXXUpdate" as input? Can someone help me with this?
<access>
<total>1</total>
<success>true</success>
<menus name="XXX">
<Permission name="XXXUpdate">
<component name="Save">savebuttonid</component>
<component name="add">addbuttonid</component>
<component name="accesscode">accesscode button id</component>
</Permission>
<Permission name="XXXRestore">
<component name="restore">restorebuttonid</component>
</Permission>
</menus>
</access>
Ext.define('User', {
extend: 'Ext.data.Model',
fields: ['Permission','component']
});
var store = Ext.create('Ext.data.Store', {
model: 'User',
autoLoad:true,
proxy: {
type: 'ajax',
url : 'Test2.xml',
reader: {
type : 'xml',
model: 'User',
record: 'menus',
root: 'access'
}
}, listeners:{
load:function(store, recs, successful, eOpts) {
//print records here
}
}
});