AtulDawkhare
13 Dec 2011, 9:56 PM
Hi there,
I have Grid with paging. It's working very fine. Now I have added Search / filter to my Gird.
Now my query is, Searching is preformed only on the the current page.
e.g. If there are 10 pages and I am on 1st page. If entered any keyword in search box, it searched only in the current page ONLY i.e on 1st page. Even if the record is present on the 8th or any other pages, the searched result show no record found.
Also One thing I want to mentioned here is, It is client / local Paging.
Please suggest me , how will I get full Or complete store? So that I can pass the store object to the following code.
Code:-
I have used "LiveSearchGridPanel.js"
me.store.each(function(record, idx) {
var td = Ext.fly(me.view.getNode(idx)).down('td'),
cell, matches, cellHTML;
while(td) {
cell = td.down('.x-grid-cell-inner');
matches = cell.dom.innerHTML.match(me.tagsRe);
cellHTML = cell.dom.innerHTML.replace(me.tagsRe, me.tagsProtect);
// populate indexes array, set currentIndex, and replace wrap matched string in a span
cellHTML = cellHTML.replace(me.searchRegExp, function(m) {
count += 1;
if (Ext.Array.indexOf(me.indexes, idx) === -1) {
me.indexes.push(idx);
}
if (me.currentIndex === null) {
me.currentIndex = idx;
}
return '<span class="' + me.matchCls + '">' + m + '</span>';
});
// restore protected tags
Ext.each(matches, function(match) {
cellHTML = cellHTML.replace(me.tagsProtect, match);
});
// update cell html
cell.dom.innerHTML = cellHTML;
td = td.next();
}
}, me);
29988
I have Grid with paging. It's working very fine. Now I have added Search / filter to my Gird.
Now my query is, Searching is preformed only on the the current page.
e.g. If there are 10 pages and I am on 1st page. If entered any keyword in search box, it searched only in the current page ONLY i.e on 1st page. Even if the record is present on the 8th or any other pages, the searched result show no record found.
Also One thing I want to mentioned here is, It is client / local Paging.
Please suggest me , how will I get full Or complete store? So that I can pass the store object to the following code.
Code:-
I have used "LiveSearchGridPanel.js"
me.store.each(function(record, idx) {
var td = Ext.fly(me.view.getNode(idx)).down('td'),
cell, matches, cellHTML;
while(td) {
cell = td.down('.x-grid-cell-inner');
matches = cell.dom.innerHTML.match(me.tagsRe);
cellHTML = cell.dom.innerHTML.replace(me.tagsRe, me.tagsProtect);
// populate indexes array, set currentIndex, and replace wrap matched string in a span
cellHTML = cellHTML.replace(me.searchRegExp, function(m) {
count += 1;
if (Ext.Array.indexOf(me.indexes, idx) === -1) {
me.indexes.push(idx);
}
if (me.currentIndex === null) {
me.currentIndex = idx;
}
return '<span class="' + me.matchCls + '">' + m + '</span>';
});
// restore protected tags
Ext.each(matches, function(match) {
cellHTML = cellHTML.replace(me.tagsProtect, match);
});
// update cell html
cell.dom.innerHTML = cellHTML;
td = td.next();
}
}, me);
29988