2011-06-30 8 views
0

行を編集する最初のクリックは素晴らしいですが、ダイアログを閉じて別の行編集ボタンをクリックすると例外がスローされます。 デバッグ時にjquery.min.jsで見た "#"記号がクラッシュしました。私の推測では、この無効な文字が何とか得られます。コード:あなたはcolModelで一部の列の定義にname: ''name: ' 'を使用編集グリッドの行ダイアログ "例外がスローされ捕捉されません"

$("#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

。違います。 nameプロパティは、空白を持たない一意の名前またはspecial charactersでなければなりません。

+0

ありがとう@Oleg、名前にテキストが追加されました。 – Red

+1

@ user767204:ようこそ!問題が解決した場合は、回答を「受け入れる」ことができます(詳しくは、[こちら](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235)を参照)。 )。 – Oleg