Forum


12:24

03/02/2009

Hi I wonder if you could help me in my colModel section I have defined a column with a (readonly) checkbox ie :-
{ name:
'BD', index: 'BD', width: 40, align: 'center', sortable: false,edittype:'checkbox',editoptions:{value:"true:false"}},
But when the table is displayed I see "true" or "false" in that column can you tell me where I've gone wrong. The JSON data return by the server passes back "true"/"false" for this item.
Thanks
01:31

Moderators
30/10/2007

Hello,
In your case you will have checkbox when you edit the data. To solve this use the new formatter. You just need this:
{ name:
'BD', index: 'BD', width: 40, align: 'center', sortable: false,
formatter:'checkbox',editoptions:{value:“true:false”}},
I.e replace edittype with formatter. Do not forget to include the jquery.fmatter.js from 3.4 beta.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
06:35

03/02/2009

Hi Tony
Thanks for the reply-I tried that still no success - I included jquery.fmatter.js from 3.4 beta only. I then installed 3.4 beta in its entirety and then recieved "Object doesn't support this property or method" exception when calling jqGrid here is the code :-
$("#monitor").jqGrid({
url: 'MonitorHandler.ashx?allData=true&fcm=' + getURLParam('fcm'),
datatype: 'json',
mtype: 'GET',
colNames: ['Firm', '%Usage', 'Adj Max Quan', 'BD', 'SD', 'Current Pos', 'Max Quan', 'Pos Limit', 'All Out'],
colModel: [
{ name: 'CreditEntity', index: 'CreditEntity', width: 120, align: 'center'},
{ name: 'Usage', index: 'Usage', width: 120, align: 'center', number: true },
{ name: 'AdjMaxQuan', index: 'AdjMaxQuan', width: 130, align: 'center', number: true },
{ name: 'BD', index: 'BD', width: 40, align: 'center', sortable: false, formatter: 'checkbox',editoptions:{value:"true:false"} },
{ name: 'SD', index: 'SD', width: 40, align: 'center', sortable: false, formatter: 'checkbox',editoptions:{value:"true:false"} },
{ name: 'CurrPos', index: 'CurrPos', width: 120, align: 'center' },
{ name: 'MaxQuan', index: 'MaxQuan', width: 120, align: 'center',number: true },
{ name: 'PositionLimit', index: 'PositionLimit', width: 120, align: 'center', number: true },
{ name: 'AllOut', index: 'AllOut', width: 80, align: 'center', sortable: false, formatter: 'checkbox',editoptions:{value:"true:false"}}],
sortname: 'CreditEntity',
afterInsertRow: function(rowid, rdata) {
if (rdata.Usage >= 50.0 && rdata.Usage < 80.0) {
$('#' + rowid, '#monitor').css({ background: '#FFFF00' })
}
else if (rdata.Usage >= 80.0 && rdata.Usage < 90.0) {
$('#' + rowid, '#monitor').css({ background: '#DA70D6' })
}
else if (rdata.Usage >= 90.0 ) {
$('#' + rowid, '#monitor').css({ background: '#FF0000' })
}
},
sortorder: "desc",
imgpath: 'jscript/themes/basic/images'
});
Any ideas ? Also can you tell me how I can change the color of a row dependant on its value after I have updated a row(s) using setRowData.
Thanks again Tony BTW great jQuery is a great piece of work
09:11

Moderators
30/10/2007

Hello,
Be a sure that the file is loaded. Also clear the cache- it should work.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
02:38

Moderators
30/10/2007

Hello,
Try with pure grid only without any events?
"Object doesn't support this property or method" - means that something is wrong with your code.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
38 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66