Ext.ux.maximgb.tg.EditorGridPanel
所形成的树形表格,如果当右侧数据更改后,会出现节点位置偏(左)移,这要怎么解决了,
解决方法:
在引入的js文件TreeGrid.js中,只要重写这些方法即可:
onAdd : function(ds, records, index)
{
Ext.ux.maximgb.tg.GridView.superclass.onAdd.call(this, ds, records, index);
if (this.mainWrap) {
//this.updateAllColumnWidths();
this.processRows(0);
}
},
onRemove : function(ds, record, index, isUpdate)
{
Ext.ux.maximgb.tg.GridView.superclass.onRemove.call(this, ds, record, index, isUpdate);
if(isUpdate !== true){
if (this.mainWrap) {
//this.updateAllColumnWidths();
this.processRows(0);
}
}
},
onUpdate : function(ds, record)
{
Ext.ux.maximgb.tg.GridView.superclass.onUpdate.call(this, ds, record);
if (this.mainWrap) {
//this.updateAllColumnWidths();
this.processRows(0);
}
},
在每个方法中加入以下代码即可:
this.grid.view.refresh();
重写后为:
onAdd : function(ds, records, index)
{
Ext.ux.maximgb.tg.GridView.superclass.onAdd.call(this, ds, records, index);
if (this.mainWrap) {
//this.updateAllColumnWidths();
this.processRows(0);
// add
this.grid.view.refresh();
}
},
onRemove : function(ds, record, index, isUpdate)
{
Ext.ux.maximgb.tg.GridView.superclass.onRemove.call(this, ds, record, index, isUpdate);
if(isUpdate !== true){
if (this.mainWrap) {
//this.updateAllColumnWidths();
this.processRows(0);
// add
this.grid.view.refresh();
}
}
},
onUpdate : function(ds, record)
{
Ext.ux.maximgb.tg.GridView.superclass.onUpdate.call(this, ds, record);
if (this.mainWrap) {
//this.updateAllColumnWidths();
this.processRows(0);
// add
this.grid.view.refresh();
}
},
即在添加、删除、更改后,刷新一遍即可!
另外在Grid中有时候会统计所有子节点的值进行汇总时,store中只有query()方法,但有时会有问题,出现统计子节点出现计算错误:
var mixedCollection=s.queryExact("_parent",record.get("_id"));
这个时候就要重写store中原的的方法query了:
store中原有方法query为:
query : function(property, value, anyMatch, caseSensitive){
var fn = this.createFilterFn(property, value, anyMatch, caseSensitive);
return fn ? this.queryBy(fn) : this.data.clone();
},
重写query方法,改名后(queryExact --自定义)为:
Ext.override(Ext.data.Store,{
queryExact : function(property, value, anyMatch, caseSensitive){
var fn = this.createFilterFn(property, value, anyMatch, caseSensitive, true);
return fn ? this.queryBy(fn) : this.data.clone();
}
});
- 大小: 5.4 KB
分享到:
相关推荐
extjs多选下拉框,Ext.ux.form.LovCombo,extjs 以修复多选下拉框火狐下取不到值的问题,火狐下div不显示背景色的问题
2、Ext.ux.grid.feature.Tileview 3、Ext.ux.upload.Button 4、Ext.ux.toggleslide.ToggleSlide 5、Ext.ux.container.ButtonSegment 6、Ext.ux.grid.plugin.RowEditing 7、Ext.ux.grid.plugin.DragSelector 8、Ext....
EXTjs的上传组件
Most configuration options are inherited from Ext.Window (see ExtJs docs). The added ones are: url - the url where to post uploaded files. base_params - additional post params (default to {}). ...
ExtJs选中var editor = new Ext.ux.grid.RowEditor详解.txt
Ext.ux.GoogleChart extjs插件Ext.ux.GoogleChart extjs插件
感谢 Ericzhen 远离颠倒梦想,蕴籍无上清凉 这里引用它的资源 仅作分享 http://www.cnblogs.com/Ericzhen/archive/2012/06/11/2545186.html
NULL 博文链接:https://lingf.iteye.com/blog/1188654
实现treegrid组件的(CRUD)读取、新增、修改、删除 //设置grid单元格处于编辑状态 selcell:function(arow,acol){ this.editingPlugin.startEditByPosition({row:arow,column:acol}); }, selcell2:function(node,...
Extjs4 comboboxTree下拉树型菜单,完美支持多选、单选,绝对好用。来源于网络,稍作修改。
Extjs4实现的Ext.ux.form.TinyMCETextArea html580 inyMCETextArea
NULL 博文链接:https://atian25.iteye.com/blog/1019910
NULL 博文链接:https://maoyi606.iteye.com/blog/1782825
该ext.jsb2文件是ExtJS3.4.0中的,因ExtJS4.0.0中没有这个文件,但可以与4.0.0版本共用。
Ext.ux.UploadDialog extjs上传文件的组件,免费下载
ExtJS开发插件及Ext包.一个是Spket一个是Ext包
主要用例子说明extjs4的form表单的运用,其中有表单属性说明,表单控件运用说明如: title:'表单', //表单标题 bodyStyle:'padding:5 5 5 5', //表单边距 height:120, //表单高度 width:200, //表单宽度 ...
代码如下: Ext.onReady(function() { Ext.Msg.alert(‘提示’, ‘逗号分隔参数列表’); //这种方式非常常见的 }); 效果图: 代码如下: Ext.onReady(function() { //定义 JSON(配置对象) var config = { ...
用extjs4 TreeGrid做的report报表
一、ExtJs中的Ajax:Ext.Ajax.request 23 二、元素对象Ajax式更新:Ext.Updater,[已弃用] 29 第四章 Ext.XTemplate 模板 31 一、使用标签tpl和操作符for 33 二、在子模板的范围内访问父元素对象 34 三、数组元素索引...