1
我想在後面的代碼中調用cellTemplate函數,但我無法調用。有沒有辦法從後面的代碼調用這個函數?我曾嘗試,你可以看到在下面但是行顯示 「ShowButton」Devextreme JS DXGrid如何在後面的代碼中調用cellTemplate
ListDxColum.Add(new DxColumns(){
dataField = "cor_ref",
caption = "",
allowFiltering = false,
cellTemplate = "ShowButton"
});
JAVASCRIPT
var orders = rec.documentList;
$("#gridContainer").dxDataGrid({
dataSource: {
store: {
type: "array",
key: "ID",
data: orders
}
},
paging: {
pageSize: 8
},
showRowLines: true,
showBorders: true,
selection: {
mode: "single"
},
filterRow: { visible: true },
//searchPanel: {
// visible: true
//},
columns: rec.DxColumHeader,
paging: { pageSize: 6 },
wordWrapEnabled: true,
filterRow: { visible: false },
columnAutoWidth: false
});
function ShowButton(container, options) {
console.log(options.data["cor_ref"]);
}
,'後面的代碼是服務器端的C#代碼,不是嗎?如果是這樣,就不可能從c#調用客戶端devextreme代碼。 – Sergey
是的,它是c#中的服務器端。謝謝你通知我 –