This is my first attempt at putting a checkbox in a grid panel. I'm not sure if how I did it is "the right way". Meaning, could the way I did it bite me later down the road... It's working but I'm wondering if my selModel config is "ok".
Code:
//grid..... Ext.define('Books.view.BookmastGrid', { extend: 'Ext.grid.Panel', alias: 'widget.bookmastgrid', initComponent: function() { var me = this; Ext.apply(me, { store: 'Bookmastpfs', stripeRows: true, frame: true, autoScroll: true, selModel: Ext.create('Ext.selection.CheckboxModel', { mode: 'SINGLE', selType: 'rowmodel' }), tbar: me.buildTbar(), dockedItems: me.buildDockedItems(), columns: me.buildColumns() }); me.callParent(arguments); },
Code:
//controller snippets.... 'bookmastgrid': { selectionchange: this.onSelectCheckBox }, onSelectCheckBox: function(model, record, opts) { var recSelected = this.getBookmastGrid().getSelectionModel().getSelection()[0]; var bkid = recSelected.get('BKID'); //..blah blah blah.... },
Comment