svsdnb

Forum Replies Created

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • svsdnb
    Participant

    the version is 5.0.1

    Mind you I do not need to edit the selected row, I need the selected row to remain checked when a user uses the edit function on the form over all. So a way to recall from the server what was selected or the checkbox to remain selected for the session.

    Here’s as simple as I can get the code down for you:

    $.jgrid.gridUnload(“#list”);

    myGrid = $(“#list”).jqGrid({
    url: baseURL + ‘/scripts/get_user_list.php’ + urlString,
    datatype: “json”,
    mtype: ‘POST’,
    width: 660,
    height: ‘100%’,
    pager: ‘#pager’,
    rowNum: 10,
    rowList: [20, 30, 40, 50, 60],
    sortname: ‘id’,
    sortorder: “asc”,
    viewrecords: true,
    multiselect: true,
    repeatitems: false,
    imgpath: ‘/scripts/jquery-ui/images’,

    colNames: [‘id’, ‘Building’, ‘Company ID’, ‘Description’, ‘Individual Name’, ‘SECCode’],
    colModel: [
    {name: ‘id’, index: ‘id’, jsonmap: ‘id’, hidden: true, width: 20},
    {name: ‘Building’, index: ‘Building’, jsonmap: ‘Building’, hidden: true, width: 20},
    {name: ‘CompanyId’, index: ‘CompanyId’, jsonmap: ‘CompanyId’, width: 110},
    {name: ‘Description’, index: ‘Description’, jsonmap: ‘Description’, sortable: true, width: 300},
    {name: ‘IndName’, index: ‘IndName’, jsonmap: ‘IndName’, width: 200},
    {name: ‘UsrNum’, hidden: true, index: ‘UsrNum’, jsonmap: ‘UsrNum’}
    ],
    jsonReader:
    {
    repeatitems: false,
    root: ‘rows’,
    id: ‘0’,
    cell: ”,
    subgrid:
    {
    root: ‘rows’,
    id: ‘0’,
    cell: ”,
    repeatitems: false
    }
    },

    // subgrid support
    subGrid: true,
    subGridUrl: baseURL + ‘/scripts/get_user_list.php’ + urlString,
    subGridModel: [{
    name: [‘Date’, ‘ID’],
    params: [‘CompanyId’],
    align: [‘center’, ‘right’],
    width: [150, 80]}
    ],

    ondblClickRow: function (id)
    {
    $(‘#recId’).val(id);
    },

    beforeRequest: function ()
    {
    blnGridLoading = true;
    // console.log(“beforeRequest(); setting blnGridLoading=true”);
    fnValidateAccount(); // Check that user has data available
    },
    loadComplete: function ()
    {

    blnGridLoading = false;
    // console.log(“loadcomplete(); setting
    blnGridLoading=false”);

    for (swap in arySwap)
    {
    if (typeof arySwap[swap][‘CompanyId’] != ‘undefined’)
    {

    $(“#list”).jqGrid(‘setSelection’, arySwap[swap][‘CompanyId’]); // select companyId
    }
    }
    fnValidateAccount(); // Check that user has data available

    },

    • This reply was modified 6 years, 11 months ago by svsdnb.
Viewing 1 replies (of 1 total)

Stay connected with us in your favorite flavor!