PDA

View Full Version : grid with checkboxes



oracle.cons.tr
19 Feb 2014, 2:10 PM
I have a checkbox grid inside a window . when i show the window first time
i am able to select checkboxes but when i open it second time and so on i can no more select
the checkboxes. grid's store is loaded from memory dynamically.

I ve tried many things but failed to figure out what i am missing here.

thanks a lot.




Ext.define('SCH.view.grid.predecessor.PredecessorGrid',{


extend : 'Ext.grid.Panel',
xtype : 'predecessorgrid',


requires: [
'Ext.grid.*',
'Ext.ux.grid.FiltersFeature',
'SCH.view.pool.grid.column.TaskColumn',
'SCH.view.pool.grid.column.ModuleNameColumn',
'SCH.view.pool.grid.column.StatusTagColumn',
'SCH.view.pool.grid.column.DeleteActionColumn',
'SCH.view.grid.predecessor.PredecessorGridToolbar'
],


selModel:
Ext.create('Ext.selection.CheckboxModel', {
mode : 'SIMPLE',
checkOnly : true
}),


closeAction :'destroy',


frame : false,
features:[
{
ftype : 'filters',
encode: false,
local : true
}
],


columnLines : false,
enableColumnHide: false,
autoScroll : true,


viewConfig : {
loadingText: "Loading predecessors ..."
},


columns:[
{
xtype : 'statustagcolumn',
width : 24
},
{
xtype : 'taskcolumn',
flex : 1
},
{
xtype : 'modulenamecolumn',
flex : 1
},
{
name : 'remove',
xtype : 'deleteactioncolumn',
tooltip : 'Remove Predecessor',
width : 24
}
],


dockedItems:
[{xtype : 'predecessorgridtoolbar'}],


setMode:function(mode) {
if(mode==='INFO') {
this.down('predecessorgridtoolbar').hide();
this.down('deleteactioncolumn').hidden=true;
}
},


constructor:function() {
this.store= Ext.create('SCH.store.PredecessorStore');
this.callParent(arguments);
}




});


Ext.define('SCH.store.PredecessorStore',{
extend :'Ext.data.Store',


storeId : 'PredecessorStore',
model : 'SCH.model.PredecessorModel',
autoLoad: false,


proxy : {
type: 'memory',
reader : {
type : 'json'
}
},


listeners : {
load:function() {
console.log('store loaded');
}
},


constructor:function() {
console.log('in predecessorStore');
this.callParent(arguments);
}


});



I load the grid like;



var g = this.down('predecessorgrid');
g.store.loadData(data.get('predecessorSummaries'));

oracle.cons.tr
19 Feb 2014, 4:24 PM
so far i've found this

when i remove


selModel:
Ext.create('Ext.selection.CheckboxModel', {
mode : 'SIMPLE',
checkOnly : true
})


the grid fires select event as expected when opened second time
but it doesnot fires select event with checkboxmodel
when the window opened second time.

palakurthivishal
19 Feb 2014, 10:14 PM
Hello oracle.cons.tr,
Can you please post a fiddle which depicts theissue so that we can help you out better, if the issue still persists?

oracle.cons.tr
20 Feb 2014, 6:38 AM
It is solved!
Problem seems to be about selection model.
when i place the selection model like below it works.


constructor:function() {


this.selModel=
Ext.create('Ext.selection.CheckboxModel', {
mode : 'SIMPLE',
checkOnly : true
});


this.callParent(arguments);
}

neetusnIntel
8 Jan 2016, 8:31 PM
I have Ext.selection.CheckboxModel in grid, when I select/clcik on checkbox it gets compressed become a vertical line, and deselect will get will work fine.53855

Gary Schlosberg
11 Jan 2016, 7:12 AM
Are you able to recreate this new issue in a Fiddle?
https://fiddle.sencha.com/#home

neetusnIntel
11 Jan 2016, 9:04 PM
Hi Gary,I tried to change it in css file ../css/ext-theme-classic/ext-theme-classic-all.css and its working fine now. .x-grid-row-checker{background-position:0 -13px} => .x-grid-row-checker{background-position:0 -1px}