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
Editing blocked after deleting a new row while in cell edit
25/03/2010
00:09
Avatar
brntcrsp
New Member
Members
Forum Posts: 2
Member Since:
24/03/2010
sp_UserOfflineSmall Offline

Following the examples from the demo site I added the following methods to add and remove rows to a clientSide data grid.

    jQuery('#add').click( function () {
        grid.jqGrid('addRowData', dummyRow, {"alias":"New Name","field_type":"","eav":"No"});
    });

    jQuery('#delete').click(function () {
        var a = grid.jqGrid('getGridParam','selrow');
        if(a) {
            grid.jqGrid('delRowData', a);
        } else {
            alert('Please select a row to delete.');
        }
    });

The problem is if I am editing a cell in the new row, but I do not save or escape from editing then after that row is deleted the entire grid becomes non-editable. The grid deifinition is very simple:

grid.jqGrid({
    height: "100%",
    caption: "Transfer Variables",
    pager: "#gridPager",
    pgbuttons: false,
    pginput: false,
    datatype: "local",
    cellEdit: true,
    cellsubmit: "clientArray",
    colModel: [{
        name: 'id',
        label: 'Id',
        index: 'id',
        hidden: true
    },{
        name: 'alias',
        label: 'Alias',
        index: 'alias',
        width: 130,
        editable: true
    },{
        name: 'source_var_name',
        label: 'Variable Name',
        index: 'source_var_name',
        width: 100,
        // use shorthand alias defined above
        editable: true
    }, {
        name: 'field_type',
        label: 'Field Type',
        index: 'field_type',
        width: 80,
        editable: true,
        edittype: "select",
        editoptions: {value:"Identifier:Identifier;Temporal:Temporal;Transfer:Transfer"}
    }, {
        name: 'eav',
        label: 'EAV?',
        index: 'eav',
        width: 50,
        editable: true,
        edittype: "select",
        editoptions: {value:"Yes:Yes;No:No"}
    }, {
        name: 'attribute_col_name',
        label: 'Attribute Column',
        index: 'attribute_col_name',
        width: 100,
        editable: true
    }, {
        name: 'value_col_name',
        label: 'Value Column',
        index: 'value_col_name',
        width: 100,
        editable: true
    }]
    
});

25/03/2010
16:23
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

What is the value of the dummyRow?

Be a sure that this value is not empty or not duplicated.

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.

25/03/2010
19:57
Avatar
brntcrsp
New Member
Members
Forum Posts: 2
Member Since:
24/03/2010
sp_UserOfflineSmall Offline

It is an undefined variable - I want to add a row, but I don't care what the rowid is. Is there some other way to get the next available row id, or just create one without  having to specify the id?

31/03/2010
16:36
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Yes the is such way,

Set as rowid NULL - note the capital words , the the rowid will be the next record+1

Best Regsrds

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.

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