<script type="text/javascript">
var nodeSeleted = function (node, checked) {
nodeeachChild(function (child) {
childuitoggleCheck(checked);
childattributeschecked = checked;
});
parentChecked(node, checked);
//getTasks();
};
var nodeState = function (node) {
var box = nodegetUI()checkbox;
if (boxchecked) {
return 1;
} else if (boxindeterminate) {
return 2;
} else {
return 3;
}
};
//
var siblState = function (node) {
var state = new Array();
var firstNode = nodeparentNodefirstChild;
if (!firstNode) {
return false;
}
do {
statepush(nodeState(firstNode));
firstNode = firstNodenextSibling;
} while (firstNode != null)
return state;
};
//
var parentState = function (node) {
var state = siblState(node)join();
if (stateindexOf("1") == -1 && stateindexOf("2") == -1) {
return -1;
} else {
return 1;
}
}
var parentChecked = function (node, checked) {
var parentNode = nodeparentNode;
if (parentNode == null || parentNodeid == 'root') {
return false;
}
var checkbox = parentNodegetUI()checkbox;
if (typeof checkbox == 'undefined')
return false;
var check = parentState(node);
if (check == 1) {
checkboxindeterminate = false; //半选中状态
checkboxchecked = true;
} else if (check == -1) {
checkboxchecked = false;
checkboxindeterminate = false;
} else {
checkboxchecked = false;
checkboxindeterminate = true;
}
parentChecked(parentNode, checked);
};
var sn = "";
function getTasks() {
var msg = "", selNodes = TreeAllFunsgetChecked();
//debugger;
Exteach(selNodes, function (node) {
if (nodeleaf == true) {
if (msglength > 0) {
msg += ",";
}
msg += nodeid;
}
});
return msg; //+ "," + roleForfun_GridgetSelectionModel()getSelected()id;
}
</script>
<ext:TreePanel ID="TreeAllFuns" UseArrows="true" AutoScroll="true" Animate="true"
EnableDD="true" ContainerScroll="true" AutoHeight="true" Border="false" Header="false"
RootVisible="false" runat="server">
<Root>
<ext:AsyncTreeNode Text="Examples" NodeID="root" Expanded="true" Checked="False" />
</Root>
<Loader>
<ext:PageTreeLoader RequestMethod="GET" OnNodeLoad="GetExamplesNodes" PreloadChildren="true">
<EventMask ShowMask="true" Target="Parent" Msg="Loading" />
</ext:PageTreeLoader>
</Loader>
<Listeners>
<CheckChange Handler="nodeSeleted(node,checked);" />
<Render Handler="thisgetRootNode()expand(true);" Delay="50" />
</Listeners>
</ext:TreePanel>
ExtonReady(function(){
var check=new ExtformCheckbox({
boxLabel:"选择",
checked:true,
width:200,
height:100,
renderTo:"aaa",
listeners:{
check:function(){
if(checkchecked==false){
alert("ssss");
}
}
}
})
}
)
只关注listeners就行,完全可行
var e = MainGrid.getSelectionModel().selection.record;e.set(&#39;depid&#39;, &#39;10000&#39;);e.set(&#39;depname&#39;, &#39;总部&#39;);var depid = e.get(&#39;depid&#39;);var depname = e.get(&#39;depname&#39;);这个record其实就是一个json对象
首先导入扩展CheckColumn的JS文件在extjs文件包的/examples/ux/CheckColumnjs。 然后将你要用来显示true/false的那列的xtype配置成checkcolumn。 例子: {xtype:"checkcolumn",header:"头部",dataIndex:"xxxx"}
单击某个单元格时,选中的是整行,Ext默认的是RowSelectionModel——行选择模型。
行选择模型默认支持多选,鼠标单击时按住ctrl/shift就可以选择多行。如果只希望选择一行,设置singleSelect参数为true。 在Grid中设置sm为RowSelectionModel,并指
以上就是关于跪求Ext.net控件 TreePanel中如何遍历Checkboxjs代码全部的内容,包括:跪求Ext.net控件 TreePanel中如何遍历Checkboxjs代码、ext checkbox 如何判断未选中且当未选中时赋值为0、要获取Ext.grid.ColumnModel的记录,判断其是否被选中并获取选中行的数据等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)