-
20 Feb 2009 1:16 AM #1
Checkbox rendering - grid column
Checkbox rendering - grid column
I'm newbie, i've just started playing with extjs and I've applied edit-grid example to my database. I want to compliment for Your great big work !!!
I've read API documentation but I think I have some miss because I can't make simple checkbox column (only for selection of records purpose) without use plugin.
.. strange, I see "true/false" strings instead of tipical checkboxes, what I miss ?Code://checkColumn { header: "select record", dataIndex: 'foo', // not relevant (not use in dabase) editor: new fm.Checkbox({ autoShow : true }) }
-
20 Feb 2009 1:26 AM #2
Why not to use 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 3:03 AM #3
Thank's a lot for Your reply. Right, I've just tested this kind of solution and is exactly what i'm looking for.
Thank You again.
PS. In this moment I'm trying to switch my old static application (SMS gateway) to new EXTJS way. I'm planing to have unique interface with form and grid together where user can choise one or more customers to send sms message. Grid must be able to filter only mobile phones, some customers ecc (it's great tutorial on EXTJS support pages), editing, deleting eccc. Step in the future ... one interface for many features ...
-
20 Feb 2009 3:27 AM #4
I wish you good luck! Keep us briefed on your progress and show us result then, if possible.
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 4:22 AM #5
Hi,
Now I look around by google and forums to find solution for this problem:
DataDescr: LastName,FirstName,Phone,MobileCode:data = [ ('Smith','John','054111111','3333333'), ('White','Oscar','','444444'), ('Black','Peter','05414444','')]
On data.load checkbox apear only for "Smith and White" because mobile is not empty.
How I can disable (disapear) only certain checkboxes on load data ? I found solution to read /put in data.store but I don't kno how interact im to hide checkbox.
Sorry for my English.
Alberto.
-
20 Feb 2009 4:30 AM #6
Hide checkboxes on certain rows? Maybe you want Saki's rowactions plugin?
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 4:44 AM #7
Thanks fore reply,
I've checked suggested plugin. Is great plugin, i have in mind for nex my implementation, but for my purpose is too much, I need only hide some checkboxes in column if some condition in row occur (in my case: if filed "mobile" is not empty)
Alberto
-
20 Feb 2009 5:26 AM #8
maybe use a renderer then
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 7:10 AM #9
Yeah, a custom renderer is the simplest way.
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:15 AM #10
I'm still disable solve previous problem : HIDE UNWANTED CHECKBOXES (on specific condition eg: field "mobile" empty)
I've found at post:
https://extjs.net/forum/showthread.php?p=267945
this explain:
I've tryied also this solution without success.[..]
Disabling the checkbox is not supported with the current code. The checkboxes are rendered using CSS and images, not a true HTML input element. It would be possible to override the render methods in CheckColumnConfig to provide disabled support.
[..]
This is my simplified code:
I miss piece of how interface checking data with renderer: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: foo }); function foo() { return '<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); });
"If EMPTY record.data.cell THEN return ' ' " ...
Thanks in advice.
Alberto.


Reply With Quote