-
20 Feb 2009 10:18 AM #11
Which checkboxes you want to hide; checkboxes in a data cell or checkboxes of CheckboxSelectionModel?
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
20 Feb 2009 10:39 AM #12
In the demos for array grid, edit grid, they show how to use a renderer.
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
20 Feb 2009 10:39 AM #13
wow... flash response... great
I think is on CheckBoxSelectionModel. I mean:
I need hide checkbox if customer data have field "mobile" empty. This prevent to select rows with have no mobile and future checks on ServerSide. As I eplained, application have purpose to send SMS, than customers which have no Mobile inserted can't receive SMS.
Thank U again.
PS. Tomorrow I'll buy PACK-IT book, i'm very entusiast of EXT (I like OO programing style - Javascript is poor language, but i discover him again
-
20 Feb 2009 10:49 AM #14
in reply to:
About demos (array grid ecc) : rendererIn the demos for array grid, edit grid, they show how to use a renderer.
All explamples is focused to existent column in data definition, eg: amount : change color of css depend of value of amount ecc. In my case checkbox column have purpose to select only row and have no binding data i data storage, but must interact with data store to verify value of one field.
Thanks in advice.
Alberto
-
20 Feb 2009 10:52 AM #15
You can access record argument in your renderer such as:
However, keep in mind that not displaying the checkbox will not prevent record selection. You'll need to handle it programmatically.PHP Code:
var mobile = record.get('mobile');
if(true !== mobile) { // or whatever condition you need
return '';
}
else {
return '<div class="x-grid3-row-checker"> </div>';
}
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
20 Feb 2009 10:54 AM #16
I think....or thought....Checkbox was just using images, either a checked or unchecked image box. So value for field could be 1 or 0. The renderer would just show the appropriate image for the underlying value. I would have looked at using click event on that column to change the value.
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
20 Feb 2009 10:57 AM #17
Look at the last example in this section as another inspiration source:
http://extjs.com/learn/Ext_FAQ_Grid#...ing.2C_etc..29MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
20 Feb 2009 1:32 PM #18
[SOLVED]
[SOLVED]
Hi all,
Thanks for all contributors, this thread helped to clear some points of CheckboxSelectionModel.
1) Checkbox is not really <input> tag, only css class
2) Selection of some rows is insufficent for good validation (requires serverside post validation)
3) Better and clean solution is use "renderer"
NB: I've read API docs and I can't find explanation of parameters "renderer" function (look code below) but all coments in this post was helpfully to solve problem.
Screenshot

Alberto.Code:Ext.onReady(function(){ var myData = [ [ 'Albert Einstein', '05411799999', '333333333'], [ 'Albertino Einstein', '', '333334444'], [ 'Alberta Einstein', '05411799997', ''] ]; Ext.QuickTips.init(); var fm = Ext.form; var sm = new Ext.grid.CheckboxSelectionModel({ renderer: function(v, p, record) { return (record.data.cell!='') ? '<div class="x-grid3-row-checker"> </div>' : ''; } }); var cm = new Ext.grid.ColumnModel([ { id:'fullname', header: "Full Name", dataIndex: 'fullname', width: 220 }, { header: "Telephone", dataIndex: 'tel', width: 120 }, { header: "Mobile", dataIndex: 'cell', width: 120 }, sm ]); var store = new Ext.data.SimpleStore({ fields: [ {name: 'fullname'}, {name: 'tel'}, {name: 'cell'} ] }); var grid = new Ext.grid.EditorGridPanel({ store: store, cm: cm, renderTo: 'editor-grid', width:600, height:300, title:'Genius Family', frame:true, sm: sm }); store.loadData(myData); });
-
20 Feb 2009 1:49 PM #19
Explanation is here:
http://extjs.com/deploy/dev/docs/?cl...ember=renderer
You need to follow the link provided at the endMJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow


Reply With Quote