Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
checkbox not showing
03/02/2009
12:24
Avatar
PeterB
Member
Members
Forum Posts: 8
Member Since:
03/02/2009
sp_UserOfflineSmall Offline

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

05/02/2009
01:31
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

05/02/2009
06:35
Avatar
PeterB
Member
Members
Forum Posts: 8
Member Since:
03/02/2009
sp_UserOfflineSmall Offline

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

05/02/2009
09:11
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

05/02/2009
10:13
Avatar
PeterB
Member
Members
Forum Posts: 8
Member Since:
03/02/2009
sp_UserOfflineSmall Offline

Tony I've tried that and still no luck ?

06/02/2009
02:38
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

06/02/2009
12:19
Avatar
PeterB
Member
Members
Forum Posts: 8
Member Since:
03/02/2009
sp_UserOfflineSmall Offline

Tony

The above code works okay (but it still doesn't render a checkbox) with the last production release of jqGrid. I only get that exception with latest beta release and it still occurs even when I take off the 'afterInsertRow' event.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information