PDA

View Full Version : how to add data dynamically to store



Prashant0104
1 Oct 2012, 2:34 AM
Hi,
i have a problem in adding data dynamically to store, i use the following code

name.set('status', 'Offline');

this codeis work fine but when i add split button on grid then it give following error

Uncaught TypeError: Cannot call method 'hasCls' of null



Uncaught TypeError: Cannot read property 'dom' of null

i use the following code to add split button in grid


{

width : 100,
renderer : function(view, meta, record) {
var id = Ext.id();
Ext.defer(function() {
Ext.widget('button', {
renderTo : id,
text : 'Action',
menu : Ext.menu.Menu({
items : [
{
xtype : 'menuitem',
text : 'Edit'


},
{
xtype : 'menuitem',
text : 'delete'


}]
})
});
}, 50);


return Ext.String.format('<div id="{0}"></div>', id);
}
}

please help me.

vietits
1 Oct 2012, 5:07 AM
It's maybe because creation of split button happens before grid cells are rendered. You should check to make sure the element you want to render button into has existed.