2011-06-30 32 views
0

第一次單擊編輯行效果很好,但關閉對話框並單擊另一行編輯按鈕後,它會引發異常(在主題中)。 當調試時我在jquery.min.js中看到「#」符號崩潰,我猜它以某種方式得到這個無效字符。代碼:編輯網格行對話框「異常拋出並未捕獲」

$("#jqgrid").jqGrid({ 
     datatype: "local", 
     mtype: 'GET', 
     colNames: ['Pic', 'Category', 'Order', 'Name', 'Description', 'Full Price', 'Price', 'Is Pack', 'Is Active', 'Is Shipment', 'Is Pack Only', 'Attributes', 'Sites', 'Call Centers', ''], 
     colModel: [ 
         { name: 'PictureUrl', index: 'PictureUrl', width: 40, formatter: imageFormatter, align: 'center' }, 
         { name: 'CategoryID', index: 'CategoryID', width: 60, editable: true, editoptions: { size: 30, value: getProductCategories }, edittype: "select" }, 
         { name: '', index: 'ProductID', width: 40, editable: true, editoptions: { size: 30} }, 
         { name: 'ProductName', index: 'ProductName', width: 40, editable: true, editoptions: { size: 30} }, 
         { name: 'ProductDesription', index: 'ProductDesription', width: 40, editable: true, editoptions: { size: 30} }, 
         { name: 'FullPrice', index: 'FullPrice', width: 40 }, 
         { name: 'ActualPrice', index: 'ActualPrice', width: 40 }, 
         { name: 'IsPackage', index: 'IsPackage', width: 40, editable: true, editoptions: { size: 30, value: "Yes:No" }, edittype: "checkbox" }, 
         { name: 'IsActive', index: 'IsActive', width: 40, editable: true, editoptions: { size: 30, value: "Yes:No" }, edittype: "checkbox" }, 
         { name: 'IsShipment', index: 'IsShipment', width: 40, editable: true, editoptions: { size: 30, value: "Yes:No" }, edittype: "checkbox" }, 
         { name: 'IsPackageOnly', index: 'IsPackageOnly', width: 40, editable: true, editoptions: { size: 30, value: "Yes:No" }, edittype: "checkbox" }, 
         { name: '', index: '', width: 40 }, //attributes 
         {name: 'ProductInSites', index: 'ProductInSites', width: 40, editable: true, edittype: "textarea", editoptions: { rows: "2", cols: "35"} }, 
         { name: ' ', index: '', width: 40, align: 'center', editable: true, edittype: "textarea", editoptions: { rows: "2", cols: "35"} }, //callcentre 
         { name: ' ', index: '', width: 40, align: 'center', formatter: updatebutton }, //button 
        ], 
     rowNum: 20, 
     rowList: [10, 20, 30], 
     pager: '#jqpager', 
     sortname: 'OrderDate', 
     viewrecords: true, 
     sortorder: "desc", 
     caption: "Shipment Report", 
     autowidth: true, 
     height: "100%", 
     loadtext: "Loading...", 
     editurl: "ProductsList.ashx?actiontype=3" 
    }); 

回答

0

你在一些列的定義colModel使用name: ''name: ' '。這是錯誤的。 name屬性必須是無空格的唯一名稱或special characters

+0

謝謝@Oleg,將文字添加到名稱中:它工作得很好。 – Red

+1

@ user767204:不客氣!如果問題解決了,您可以「接受」答案(詳情請參見http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235)以獲取詳細信息)。 – Oleg

相關問題