Bran Smith
Bran Smith

Reputation: 59

Inline editing in jQGrid

I have developed a jqgrid and adding an inline editing functionality. The problem I am facing is when I pass data of row (two columns) to my method in controller it just passes 2nd column data and in first column data it just passes the null value. I don't kow what silly thing I am doing. In my js file, I wrote:

onSelectRow: function (id) {

        if (id) {
            alert("You are editing it");
            //jQuery('#Grid').jqGrid('restoreRow', last);
            jQuery('#grid').jqGrid('editRow', id, true);
            last = id;
            var selRowId = $('#grid').jqGrid('getGridParam', 'selrow');
            $('#grid').jqGrid('getCell', selRowId, 'TABLE_NAME');
            $('#grid').jqGrid('getCell', selRowId, 'TABLE_ALIAS_NAME');

        }
    },
    editurl: "/MyApp/Edit", 

and in controller method

public void Edit(string TABLE_NAME, string TABLE_ALIAS_NAME)

but it passes the null value for TABLE_NAME and correct value for TABLE_ALIAS_NAME.

Upvotes: 0

Views: 157

Answers (1)

Bran Smith
Bran Smith

Reputation: 59

Okay. So I got my silly mistake by myself. I thought to post my answer. By making the key:true for the column of TABLE_NAME, I got it to work.

Upvotes: 1

Related Questions