PDA

View Full Version : Change to another component



samaelal
31 Jan 2015, 3:42 PM
Good day. Guys tell me how to deal with this situation. insert kompanet



{
xtype: 'gridpanel',
title: '????? ???????? 00.00.00',
store: 'PriceStore',
columns: [
{
xtype: 'gridcolumn',
dataIndex: 'gr',
text: '??????',
width : 70,
},
{
xtype: 'gridcolumn',
dataIndex: 'naimenovanie',
flex : 1,
text: '????????????'
},
{
xtype: 'gridcolumn',
dataIndex: 'edIzm',
width : 70,
text: '??.???.'
},
{
xtype: 'gridcolumn',
dataIndex: 'cenaBezNDS',
width : 70,
text: '???? ??? ???'
}
]
}



I would like to change it to Ext.ux.LiveSearchGridPanel without changing structure. In general, something like


{
xtype: 'LiveSearchGridPanel',
title: '????? ???????? 00.00.00',
store: 'PriceStore',
columns: [
{
xtype: 'gridcolumn',
dataIndex: 'gr',
text: '??????',
width : 70,
},
{
xtype: 'gridcolumn',
dataIndex: 'naimenovanie',
flex : 1,
text: '????????????'
},
{
xtype: 'gridcolumn',
dataIndex: 'edIzm',
width : 70,
text: '??.???.'
},
{
xtype: 'gridcolumn',
dataIndex: 'cenaBezNDS',
width : 70,
text: '???? ??? ???'
}
]
}

samaelal
31 Jan 2015, 6:05 PM
Slightly altered, but still gives an error Uncaught TypeError: Cannot convert undefined or null to object
Do so:



Ext.create('Ext.ux.LiveSearchGridPanel', {
alias: 'widget.inventorylist',
store: 'PriceStore',
columnLines: true,
columns: [
{
xtype: 'gridcolumn',
dataIndex: 'gr',
text: '??????',
width : 70,
},
{
xtype: 'gridcolumn',
dataIndex: 'naimenovanie',
flex : 1,
text: '????????????'
},
{
xtype: 'gridcolumn',
dataIndex: 'edIzm',
width : 70,
text: '??.???.'
},
{
xtype: 'gridcolumn',
dataIndex: 'cenaBezNDS',
width : 70,
text: '???? ??? ???'
}
],
height: 350,
width: 600,
title: 'Live Search Grid',
renderTo: Ext.getBody(),
viewConfig: {
stripeRows: true
}
});



And try to get it here



items : ['inventorylist']

joel.watson
1 Feb 2015, 5:17 AM
Hi--

Try this for using the custom xtype:



items: [{
xtype: 'inventorylist'
}]