noDataMessage : "<span class=\"dojoxGridNoData\">本单位当前无用户信息!</span>"
要让这个属性起作用,store属性不能为null,而应该是size为0,即[],而且头信息中的Content-Range应该是items 0-0/0
loadingMessage : "请稍候...",
取消选中
var item = grid.selection.getFirstSelected();
item = grid.selection.getNextSelected(item);
// 方法1:全部列禁止排序 grid.canSort = function(){return false;}; // 方法2:指定列禁止排序 grid.canSort = function(col){ console.log(col); // 禁止第三列排序 if(Math.abs(col) == 3) { return false; } else { return true; } };
在layout中设置列的属性noresize:
{'name': 'Column 1', 'field': 'id', 'width': '100px', 'noresize': true}
或者
<th field="id" width= "200px" noresize=true >id</th>
设置'width': 'auto'也能起到禁止的作用,但是有时列宽无法控制
{ field : 'typeDesc', name : '名称', width : '100px', //cellClasses : 'test' // 方法1 cellStyles : 'white-space: normal;word-wrap:break-word;' // 方法2 }
cellStyles : 'white-space: normal;word-wrap:break-word;'
require(['dojox/grid/_RadioSelector']); require(['dojox/grid/cells/_base'],function(CellBase) var layout_radio = [{ type: "dojox.grid._RadioSelector"// type: "dojox.grid._CheckBoxSelector" },{ cells: [[ new CellBase.RowIndex({ width: 5, name: '序号' }),// 编号 {name: 'Column 1', field: 'col1'}, {name: 'Column 2', field: 'col2'}, {name: 'Column 3', field: 'col3'}, {name: 'Column 4', field: 'col4', width: "150px"}, {name: 'Column 5', field: 'col5'} ],[ {name: 'Column 6', field: 'col6', colSpan: 2}, {name: 'Column 7', field: 'col7'}, {name: 'Column 8'}, {name: 'Column 9', field: 'col3', colSpan: 2} ]]}];
autoHeight:10 // grid最大高度是10行autoHeight不但能设置true/false,还能设置数字
selectable: true