目前我使用Dojo dgrid與選擇框,文本框和兩個複選框,但我不能夠禁用整個行選擇,也當我點擊第二個複選框dgrid選擇和取消選擇不工作,它反映的第一個複選框。Dojo Dgrid行選擇不起作用並檢索dgrid選擇器的值?
1.How禁止在道場Dgrid全行選擇? 2.How得到Dgrid選擇框和文本框Dgrid的值當我點擊保存? 3,如果 我使用選擇(複選框)我不能夠呈現該列的標籤?
var columns = {
person :{
sortable: false,
renderCell: lang.hitch(this, function(object,value,node) {
if(value == true){
myTextBox = new dijit.form.TextBox({
name: "Amount",
value: "" ,
placeHolder: "Enter Amount"
}).placeAt(node);
}
})
},
description:{
label:"description",
field:"description",
sortable: false,
renderCell : lang.hitch(this, function(object,
value, node, options) {
new Select({
name : "select",
options : [ {
label : "Daily",
value : "daily"
}, {
label : "Weekly",
value : "weekly",
}]
}).placeAt(node);
}),
},
email : selector({
sortable:false,
field:"email"
})
/*i tried this instead of using selectors inserting a checkbox so that i can remove complete row selection but not working*/
email: {
sortable:false,
field:"email",
renderHeaderCell : function(node) {
var cellDiv = domConstruct.create("label", {
innerHTML : "Email"
}, node);
var checkBox = new CheckBox({
name: "checkBox",
id:"emailAddress",
checked: false,
}, cellDiv);
},
renderCell:createMessageLabel
}
};
function createMessageLabel(object,value, node,options){
console.log("node option",node);
var checkbox = new CheckBox({
name: "checkBox",
id:"emailAddress",
checked: false,
}).placeAt(node);
};
var grid = new GridView().show(gridData, columns, "",
"dgridAutoHeight", true);
function addSelection(self, event) {
console.log("Row selected: ", event.rows[0].data);
}
function removeSelection(self, event) {
console.log("Row deselected: ", event.rows[0].data);
}
grid.startup();
grid.on("dgrid-select", lang.hitch(grid, addSelection, this), true);
grid.on("dgrid-deselect", lang.hitch(grid, removeSelection, this), true);
希望我能得到一些有價值的答案....
嗨肯,謝謝你這麼多寶貴的answer..the編輯工作非常適合上述情況,但我有疑問,關於內部rendercell編輯請檢查以下內容回覆希望你能幫助我得到解決...... 。 – Malathesh
+1良好的答案和良好的參考資源 – devdar