3.2.0

How to make a simple Search / Filter option?

After browsing for hours on this forum just to come to the conclusion that
there is no workable search for this FANTASTIC script.

I cant believe it!

Just need a simple search for a loaded "tabs seperated text" file that displays the rows found with the keywords searched.

Anyone got some solution for this filtering searching problem?

Any suggestions would be highly appreciated.


JUMP
JUMP
July 24,
Hi,

We added search capabilities to the grid (actualy two grids above each other). The search grid appears dynamicly above the grid when the user fired search from his contextmenu. The contextmenu is a non activewidget extension. Per column you can search or filter and hit go to search. When go is pressed the search grid hides.

The code is open source examples can be find in the demo site.

See http://open-modeling.sourceforge.net (homepage)
See http://sourceforge.net/projects/open-modeling (project site to download code)
See http://open-modeling.dyndns.org/openmodeling215b

John Ophof
July 25,
Thanks John very interesting, but demo is giving me lost of errors in FF1.06 en IE6.X. sure gonna look into this later.

Maybe any suggestions or samples how to integrate the OM searchbox in a text loaded AW grid?

Must work local.

Thanks
JUMP
July 25,
Hi JUMP,

Can you more specific lots of errors. I am running IE6 and don't see problems. You can see the grid in the tree. Navigate to Model browser Processes. A grid will appear use right mouse click and use search.

John Ophof
July 26,
Xtra,

Download the code and look in include/openmodelinggrid.js and openmodelinggridaction.js. The search is activated by contextmenu but you can make a search button on your page or put the search filter always on a bove the grid. We use the action grid also for adding records or filter the grid. Filtering is done by sending a new URL to the server and refresh the grid.

Hope helps you further.

John Ophof
July 26,
Thanks John for your support, I will look into it tonight.

Keep you updated, also for the errors of O-M.
JUMP
July 28,
Here is a piece of code very useful for search purposes:


// start searching at next position and cycle at end
    function find(col, findString, startIndex){
        var re=new RegExp(findString,"gi");
        var max = obj.getRowProperty("count");
        pos=nextPos(startIndex);
        for (i=pos; i<max; i++){
            var index = obj.getRowProperty("value", i);
            // obj.getDataProperty() does not work with my firefox (28-july-05)
            if(obj.getDataProperty("text", index, col).search(re)>=0){
                return i;
            }
        }
        for (i=0; i<pos; i++){
            var index = obj.getRowProperty("value", i);
            // obj.getDataProperty() does not work with my firefox (28-july-05)
            if(obj.getDataProperty("text", index, col).search(re)>=0){
                return i;
            }
        }
        return -1;	// not found
    }
    // returns next position and cycle at end.
    function nextPos(index){
        var max = obj.getRowProperty("count");
        if (index<0 || index>=(max - 1)){
            return 0;
        }
        return index + 1;
    }



to see it live take a look at my demo http://www.alcor.com/AWProject.html
serge vb
July 28,
Wow the demo "Project using XML" @ http://www.alcor.com/AWProject.html is exactly what I need!

Have tried implementing the code Serge gave but am totally lost now.

How should I make this work with a PLAIN TEXT file to work locally?

Want to create 1 searchbox (to search whole table) in 1 frame and the grid in the other frame.


Need this badly.

Any help please! (Serge or John maybe)

Thnx in advance.
JUMP
July 29,
Jump,

See also

http://www.activewidgets.com/javascript.forum.6305.1/adding-record.html

for screenshots

J
John Ophof
July 29,
@ Jonh

I have tried your code, but failed to even get a text file loaded or worse to get a proper page.

Also i couldn't enter the OM live demo page at this moment.

Please help me to get this script working in 2 frames and with plain text file.

Thanks for all your effort







JUMP
July 29,
Hi,

Send me a message via jophof007_athotmail.. I need some details what code you are trying to run and some details of your problems.

The demo site is still up and running.
http://open-modeling.dyndns.org/openmodeling215b use IE or Firefox (deerpark give some problem in the tree menu).

John
John Ophof
July 30,

This topic is archived.

See also:


Back to support forum