|
发表于 2017-6-30 11:43:27
|
显示全部楼层
1.重写第一次层list下的class为info的tr的bind-click事件如下:
- Model.prototype.tr7Click = function(event) {
- var $e = $(event.currentTarget);
- var rowid = event.bindingContext.$object.getID();
- var cData = this.comp("bizData2");//里层嵌套list关联的data
- var rows = cData.find([ "fZB" ], [ rowid ]);
- if (rows.length > 0) {
- alert(1);
- $('>td>i.x-expand-i', $e).toggleClass('icon-arrow-right-b');
- }
- $e.next().toggleClass('hide');
- };
复制代码
2.在1中这个tr同级的tr上设置bind-visible
如:bind-visible="$model.rowVisible($object)"
rowVisible函数的实现如下:- Model.prototype.rowVisible = function(event) {
- var rowid = event.getID();
- var cData2 = this.comp("bizData2");//里层嵌套list关联的data
- var rows = cData2.find([ "fZB" ], [ rowid ]);
- if (rows.length > 0) {
- return true;
- }
- else
- return false;
- }
复制代码
|
|