soccerenz
soccerenz

Reputation: 142

Error "No url is set" at row editing in jqgrid

I Found dialog with text "No url is set" when edit row at jqgrid. After press enter, i found dialog with text "No url is set". anyone can help me about this problem?

This is my jqgrid code

function callIdGrid() {
    var lastSel;
    jQuery("#id_grid").jqGrid({
        height:200,
        width:655,
        colNames:['Name','Address','Amount'],
        colModel:[{
            name:'acctId',
            index:'acctId',
            width:150,
            editable:true
        },{
            name:'address',
            index:'address',
            width:150,
            editable:true
            }
        },{
            name:'amount',
            index:'amount',
            formatter:'currency',
            width:150,
            editable:true
        }],
        pager: '#id_pager',
        sortname: 'acctId',
        viewrecords: true,
        sortorder: "desc",
        caption:"Accounts",
        cellEdit: true,
        editurl:"noabjad.json",
        onSelectRow: function(acctId){
        if(acctId && acctId!==lastSel){
        jQuery('#id_grid').jqGrid('restoreRow',lastSel);
        jQuery('#id_grid').jqGrid('editRow',acctId,true,onSaveSuccess);
        lastSel=acctId;
        }
        }
        editurl: 'clientArray'
    }) ;
    jQuery("#id_grid").jqGrid('navGrid','#id_pager',{
        add:true,
        del:false,
        search:false,
        edit:true
    },{
        reloadAfterSubmit:false
    },{
        reloadAfterSubmit:false
    }).navButtonAdd("#id_pager",{
        caption:"",
        buttonicon:"",
        onClickButton:function(){
        var datarow = {acctId: "", address: "", amount: ""};
        var su=jQuery("#id_grid").addRowData("X",datarow,"first");
        if(su) { jQuery("#id_grid").setSelection('X') }
    }

    });
    function onSaveSuccess(xhr){
        response = xhr.responseText;
        if(response == 1) return true; return false;
    }
}

Upvotes: 1

Views: 10999

Answers (2)

Eric
Eric

Reputation: 11

editRow() has only two params, I'm not sure your code works

jQuery('#id_grid').jqGrid('editRow',acctId,true,onSaveSuccess);

editRow(rowid, keys) - accept two parameters:

  1. rowid - the unique id of the row
  2. keys - which when true - we can use Enter and Escape keys to save and cancel editing

Upvotes: 1

Oleg
Oleg

Reputation: 221997

How many grids are on the page? In the code which you posted you defines jqGrid "#id_grid" with the pager "#id_grid". On the other side inside of onClickButton of the navButtonAdd and inside of the onSelectRow you use inline editing of another grid: "#TransaksiDisbursed".

Did you defined editurl parameter (like editurl: 'clientArray') for the second ("#TransaksiDisbursed") grid or existing "#TransaksiDisbursed" in your code is just cut&paste error?

Upvotes: 1

Related Questions