亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

設置并使用localStorage在表單編輯期間保留復選框選擇

設置并使用localStorage在表單編輯期間保留復選框選擇

大話西游666 2021-05-12 14:19:15
我有一個表單,jqGrid用于表單的一部分。本部分顯示可以通過復選框選擇的用戶信息。在審閱頁面上,有一個用于編輯表單的選項,在此過程中,我試圖保留復選框的選擇。我正在嘗試為此使用window.localStorage,但是我不確定如何正確設置setItem。我在loadComplete中調用getItem,在這里我的編碼也可能不太正確。我現在所擁有的,當用戶去編輯時,在jqGrid中選擇第一個項目,而不是實際保存的項目。我猜是因為我沒有正確設置setItem。誰能提供指導?$.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);    },
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 204 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號