I have an EXT JS 4.2 Grid that has 2 columns that use the renderer to place checkboxes in 1 column and radio buttons in another. How can I auto increment the ID's on these HTML inputs so that I can specifically target them via EXT JS (see columns 'Full' and 'Primary')
// Render library grid
var grid4 = Ext.create('Ext.grid.Panel', {
xtype: 'gridpanel',
id:'button-grid',
store: data,
columns: [
{text: "Library", width: 170, sortable: true, dataIndex: 'name'},
{text: "Market", width: 125, sortable: true, dataIndex: 'market'},
{text: "Expertise", width: 125, sortable: true, dataIndex: 'expertise'},
{text: 'Full', dataIndex:'isFull', renderer: function() {
var rec = grid4.getStore().getAt(this.rowIndex);
return "<input type='checkbox' id='"+rec+"' />";
}},
{text: 'Primary', dataIndex:'isPrimary', renderer: function() {
return "<input type='radio' />";
}},
],
columnLines: false,
selModel: selModel,
// inline buttons
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
ui: 'footer',
layout: {
pack: 'center'
},
items: []
}, {
xtype: 'toolbar',
items: []
}],
width: 600,
height: 300,
frame: true,
title: 'Available Libraries',
iconCls: 'icon-grid',
renderTo: Ext.get('library-grid')
});
UPDATE: The ID's are now incrementing, thank you!
Now, I have one other question: I am not seeing the checked:checked flag being set when I check an item in the EXT grid, how would I do something like the code below. I want to check to see if the element is checked
if(document.getElementById("#isFull-"+record['index']+"").checked == true){
var myVar = true;
}
rec
contain an index number you can use? – Aaron Miller