View Full Version : x-grid3: Change and apply filters (via script)

15 Nov 2010, 12:32 PM
Hi everybody,

I've got a little problem with some program at work. It wasn't programed very user friendly so I thought I'd try to automatize some reoccuring tasks, using e.g Greasemonkey and iMacros (for FireFox). Which worked so far, but now I've got stuck :">.
Is there a way to use e.g. Greasemonkey or some other tool to automatically alter the filter on a x-grid3 column?
I'd have to set one option filter (true, false or conf), one string filter (including filter string) and the sort order of one date column.

Any help would be appreciated greatly



18 Nov 2010, 12:09 PM
No idea?
Was this an inappropriate question?

1 Dec 2010, 8:12 AM
Is this forum dead, or has no one any ideas?

To show how impractical this particular peace of software was written, here a very repetitive standard task:
The program features three x-grid3 elements each filled with a load of data for the current day - loadup time avg. 20sec.
The first thing to do then is to select a new from-date (normally next day) - loadup time avg. 10sec - meanwhile I can't do anything else - result empty grids.
Then I set the new to-date (same as from-date as I only want one day) - loadup time avg. 10sec. - can't do anything else
Then I have to set the option filter to true - loadup time avg. 10sec. - can't do anything else
Then I have to set the string filter - loadup time avg. 10sec. - can't do anything else
Then I have to sort for a third column - loadup time avg. 10sec - can't do anything else
Now after more than a minute of waiting I can actually get to work, select the wanted data, press one button and that was the job, but now the stupid program goes back to the original defaults!!!!!
For a net action time of merely five seconds I have to wait over a minute and have to enter the "same" data over and over again. This cries for automation, where I write one script, that sets ALL the data and filters and THEN reloads the x-grid3-data.

Is this realy impossible? Can really noone help me?
If noone knows anything, does anybody know anyone who does know more?

Thanks for any suggestion

a really desperate user of some crappy software - which people have bought who don't care anything about usability or the time their employees spend waiting for useless programs, but give 'em a thick ear if things are not finished yesterday.

1 Dec 2010, 9:52 AM
I don't think anyone understands.

"x-grid3" is just a prefix of some CSS classes used to style HTML inside a GridPanel.

The term "x-grid3 element" has no meaning. I don;t know what you are asking for at all.

1 Dec 2010, 12:08 PM
Oh, sorry. Obviously I'm misunderstanding some things here :-(
Sure, you are right. I'll try to get some more detail about the used GridPanel when I'm back at work and post that here.
For now I've just got a screenshot of one of these GridPanels with some indications what data I'd like to "inject" into the GridPanel via script and then reload this "page" with all these infos at once.


Since the quality of that screenshot isn't very good: There is one true/false/conf option filter, one column string filter, the two date fields, an arbitrary string filter (bottom right) and sort order (down arrow in column caption).
Especially the column filters give me some headache. I can use iMacros to alter the two date fields and the bottom right text filter, but the popups for the column filters are not directly attached to their columns and so I can't use iMacros for that, so i figured there might be a JS way around that problem.

Does this sound somehow more understandable? I'm not too familiar with web programming, I'm more a conventional programmer ;-)
Is there any more info I need to provide, or what should I have a closer look into?

I suppose I should also change the title of this thread, since it's obviously confusing people - but what into?

Thanks for any suggestions again


1 Dec 2010, 12:24 PM
I don't know if that may help you but try to look at examples in Ext package... see the functioning of the setValue method in examples/ux/gridfilters/filter/StringFilter.js.

I think (I've no tested yet) you can call this method to set an arbitrary value for your string filter....


1 Dec 2010, 11:51 PM
Thanks filippo.ferrari,
I have downloaded now the ExtJS 3.3.1 package and had a look at that example - :"> I should have done that earlier.
From here I might be able to get on with it - and I actually might start to understand more, than just copy-pasting a boiler plate solution (wich I was hoping for ;)).

BTW I tried the updated "Grid Filtering" sample in "/examples/index.html#sample-4", but IE8 would not show the grid at all and FireFox 3.6.12 has just given me the grid but no data in it.

Thanks again