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
Editable checkboxes
11/02/2010
19:18
Avatar
brecht
Member
Members
Forum Posts: 9
Member Since:
11/02/2010
sp_UserOfflineSmall Offline

Hi

Situation:
I have a grid containing dynamic rows & colls filled with checkboxes.

Purpose is to save changes made to those checkboxes.

Image Enlarger

Problem:

When clicking a checkbox, the edit mode isn't triggered and therefore no change has been made.
I have to click on a cell to do this.

Image Enlarger

Click on cell marks cell changed and value has changed.

Image Enlarger

During my search on the forum I found following topics:
http://www.trirand.com/blog/?p.....p;search=1
http://www.trirand.com/blog/?p.....-jqgrid-36

Neighter of them could provide me a solution.

Source (limited):

$("#grid").jqGrid(
{
url: '.../GridData',
datatype: 'json',
colModel:
[{name:'field1',index:'field1',sortable:false,width:25,align:'center',
formatter:'checkbox',formatoptions:{disabled:false},
editable:true,edittype:'checkbox',editoptions:{value:'true:false'},search:false},
{name:'field2',index:'field2',sortable:false,width:25,align:'center',
formatter:'checkbox',formatoptions:{disabled:false},
editable:true,edittype:'checkbox',editoptions:{value:'true:false'},search:false}]
multiselect: true,
multiboxonly: true,
cellEdit: true,
cellsubmit: 'clientArray',
mtype: "POST",
pager: $('#gridPager'),
rowNum: 20,
rowList: [10, 20, 30, 50, 100],
caption: 'caption',
toolbar: [true, "top"],
height: '100%'
});
Thanks in advance
Brecht
18/02/2010
06:39
Avatar
glittle
Member
Members
Forum Posts: 31
Member Since:
23/01/2010
sp_UserOfflineSmall Offline

I've also noticed that I cannot click on a check box to edit. I have to click beside it. (I'm using Cell Edit).

Please fix so that I can click directly on the check box to turn the cell into edit mode.

Is there a quick fix I can do before it is fixed?

Glen

18/02/2010
13:13
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hi!

I implement switching in edit mode inside of ondblClickRow and have no problem. The code can looks like following:

var lastSel = -1;
var grid = jQuery('#list').jqGrid({
    ...
        ondblClickRow: function(id, ri, ci) {
            if (id && id !== lastSel) {
                if (lastSel>=0) grid.restoreRow(lastSel);
                lastSel = id;
            }
            grid.editRow(id, true, null, null, urlEdit + '/' + id, null,
                function(rowid, response) {
                ...
                }
        },
        onSelectRow: function(id) {
            if (id && id !== lastSel) {
                if (lastSel >= 0) grid.restoreRow(lastSel);
                lastSel = id;
            }
        },

        ...
}).navGrid('#pager',...);

Best regards
Oleg

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
46 Guest(s)

Currently Browsing this Page:
1 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