@ivanleblanc
Sorry, it was a stupid mistake. I put the feature config in custom grid's parent class.
I should have updated my post, but I was caught up in super ultra urgent project back then. My sincere apologies for wasting your time.
Thanks
Printable View
@ivanleblanc
Sorry, it was a stupid mistake. I put the feature config in custom grid's parent class.
I should have updated my post, but I was caught up in super ultra urgent project back then. My sincere apologies for wasting your time.
Thanks
I added a functionality for a column based searchable configuration.Code:Ext.each(columns, function(column) {
var disable = false;
if(column.text && column.dataIndex && column.dataIndex != '') {
Ext.each(this.disableIndexes, function(item) {
disable = disable ? disable : item === column.dataIndex;
});
if(!disable) {
if(typeof column.searchable != 'undefined' && column.searchable == false) {
disable = true;
}
}
if(!disable) {
menu.add({
xtype: 'menucheckitem',
text: column.text,
hideOnClick: false,
group:group,
checked: 'all' === this.checkIndexes,
dataIndex: column.dataIndex,
});
}
}
}, this);
This can be used like
Code:this.columns = [{
text:'ID',
dataIndex:'id',
width:50,
searchable:false
},{.....
Bugfix for datecolumns with the format property like:
Code:,{
text:'date',
dataIndex:'datecreated',
xtype:'datecolumn',
format:'d.m.Y H:i'
}
The error before was the follow 'format is null' because the format or dateFormat was null in the field (the error only occured in local mode):Code:// grid's store filter
if('local' === this.mode) {
store.clearFilter();
if(val) {
store.filterBy(function(r) {
var retval = false;
this.menu.items.each(function(item) {
if(!item.checked || retval) {
return;
}
var rv = r.get(item.dataIndex);
var cformat = this.grid.columns[Ext.Array.indexOf(Ext.Array.pluck(this.grid.columns, 'dataIndex'), item.dataIndex)].format;
rv = rv instanceof Date ? Ext.Date.format(rv, this.dateFormat || cformat) : rv;
var re = new RegExp(val, 'gi');
retval = re.test(rv);
}, this);
if(retval) {
return true;
}
return retval;
}, this);
}
else {
}
}
Attachment 35032
Does Ivanblanc's 4.0 port work with 4.1? Or is there a 4.1 native alternative?
This is such a great feature, I keep hoping they will make it part of the toolkit.
I can use this port to a grid with data from the server?
Just get it to work with grid-array. :(
Hi, guys. Who knows how to make this plugin work with a grid having grouped headers like header 1 -- header 1.1 header 1.2. Now it is possible to search over "simple" headers. Grouped headers are ignored.
Attachment 38126
I made it work for me. Instead of
I simply wrote this piece of codePHP Code:Ext.each(columns, function(column) {
var disable = false;
if(column.text && column.dataIndex && column.dataIndex != '') {
Ext.each(this.disableIndexes, function(item) {
disable = disable ? disable : item === column.dataIndex;
});
if(!disable) {
menu.add({
xtype: 'menucheckitem',
text: column.text,
hideOnClick: false,
group:group,
checked: 'all' === this.checkIndexes,
dataIndex: column.dataIndex,
});
}
}
}, this);
Now it iterates trough all columns.PHP Code:var cls = this.grid.headerCt.getGridColumns();
var i = 0;
while(i < cls.length){
//i == 0 is my first check column
if(this.grid.headerCt.getHeaderAtIndex(i) && i != 0) {
menu.add({
xtype: 'menucheckitem',
text: this.grid.headerCt.getHeaderAtIndex(i).text,
hideOnClick: false,
group:group,
checked: 'all' === this.checkIndexes,
dataIndex: this.grid.headerCt.getHeaderAtIndex(i).dataIndex,
});
}
i++;
}
Hello
I did as your instruction to plugin the grid search function, but it raise an error
[COLOR=red !important]Uncaught TypeError: Object #<Object> has no method 'reg' Ext.ux.grid.RowActions.js:423[/COLOR]
[COLOR=red !important]Uncaught TypeError: Object function (parentNode, containerIdx) {
} has no method 'createSequence' Ext.ux.grid.Search.js:169
What is the problem?
Thank you
[/COLOR]
Pls am new to Ext js. I will like to be directed on how to use it.