jQuery MiniUI

标题: checkboxcolumn,无论怎么点都选不中。。。 [打印本页]

作者: zuzjx    时间: 2013-6-24 17:29:34     标题: checkboxcolumn,无论怎么点都选不中。。。

本帖最后由 zuzjx 于 2013-6-24 17:31 编辑

在一个treegrid中加一列checkbox 但是checkbox 怎么都选不中,很囧~~
<div id="projectTree" class="mini-treegrid" url="getProjectList.htm"
                style="width: 100%; height: 580px;" treeColumn="c_name" showTreeIcon="false"
                idField="c_path" parentField="parent_path" resultAsTree="false"
                allowResize="true" expandOnLoad="true" allowLeafDropIn="true"
                allowDrag="true" allowDrop="true" dataField="data"
                allowCellEdit="true" allowCellSelect="true"
                editNextOnEnterKey="true"
                 allowAlternating="true">
                <div property="columns">
                    <!-- <div type="indexcolumn"></div> -->
                    <div iconCls="icon-add" type="expandcolumn">详情</div>
                    <div type="checkboxcolumn" width="20" checkedchanged="onSelectionChanged">选择</div>
                    <div type="comboboxcolumn" autoShowPopup="true" name="i_state"
                        field="i_state" width="60" allowSort="true" align="center"
                        headerAlign="center">
                        状态<input property="editor" class="mini-combobox"
                            style="width: 100%;" data="states" />
                    </div>
                    <div name="c_name" field="c_name" width="160">
                        名称 <input property="editor" class="mini-textbox" minValue="0"
                            maxValue="100" style="width: 100%;" required="true" />
                    </div>
                    <div type="comboboxcolumn" autoShowPopup="true" name="i_type"
                        field="i_type" width="60" allowSort="true" align="center"
                        headerAlign="center">
                        类型<input property="editor" class="mini-combobox"
                            style="width: 100%;" data="types" />
                    </div>
                    <div field="end_time" width="80" dateFormat="yyyy-MM-dd">
                        结束日期 <input property="editor" class="mini-datepicker"
                            style="width: 100%;" />
                    </div>
                </div>
            </div>

作者: factory    时间: 2013-6-24 17:34:41

无法选中?
你参考我们的demo:http://www.miniui.com/demo/#src=datagrid/celledit.html   婚否这一列
作者: zuzjx    时间: 2013-6-24 17:42:11

本帖最后由 zuzjx 于 2013-6-24 17:43 编辑
factory 发表于 2013-6-24 17:34
无法选中?
你参考我们的demo:http://www.miniui.com/demo/#src=datagrid/celledit.html   婚否这一列 ...

代码发出来了。麻烦版主帮忙瞅瞅。如果 添加showCheckBox="true"这个属性。那checkbox就乱了。。。具体版主可以测试一下
我想用这列checkbox代替treegrid的showCheckBox="true"这个属性自带的checkbox
作者: factory    时间: 2013-6-24 17:44:45

zuzjx 发表于 2013-6-24 17:42
代码发出来了。麻烦版主帮忙瞅瞅。如果 添加showCheckBox="true"这个属性。那checkbox就乱了。。。具体版 ...

不是,你先仔细看看我们的demo,我觉得你现在很混乱,showCheckBox是前面的checkcolumn的,不是checkboxcolumn的选择框。
另外,你在上面写了个checkedchanged="onSelectionChanged" 这个是什么意思。

作者: zuzjx    时间: 2013-6-24 17:56:31

factory 发表于 2013-6-24 17:44
不是,你先仔细看看我们的demo,我觉得你现在很混乱,showCheckBox是前面的checkcolumn的,不是checkboxc ...

恩,是的,版主厉害。如何把checkcolumn 和字段分开?并且做成这种效果呢?[attach]2221[/attach]
作者: factory    时间: 2013-6-25 09:58:25

zuzjx 发表于 2013-6-24 17:56
恩,是的,版主厉害。如何把checkcolumn 和字段分开?并且做成这种效果呢? ...

这个我们是有demo的,checkcolumn只是一列给用户多选的列,如果你要让自己的列呈现为checkbox的话,需要用到checkboxcolumn,http://www.miniui.com/demo/#src=datagrid/celledit.html

参考下“婚否”这一列
1,设置type="checkboxcolumn"
2.trueValue="1" falseValue="0"   “1”和“0”是你的值,比如你的值可能是true和false或者其他的
那就改成trueValue="true" falseValue="false"




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2