:: pepysDHTMLX :: Set auto value for #combo_filter

You can see here all my code. I’m trying to use a auto value for a combo filter, but is not working. Why? Can you help me please?



Also, how can I set a default value for a text_filter?



Where can I find more details in dhtmlx documentation abuot this?





I’m waiting for your answer, thanks.



Regards,

Samuel











































































































































#combo_filter,#text_filter,#combo_filter,#combo_filter,







User (nume si prenume)

Adresa

Judet

Localitate

Actiuni & Links







Samee Doiooi





Str. Stefan cel Mare, bl. 172, sc. B, et. 2, ap. 89



Targul Mures

Iasi





editdelete









Kokolino Bombilici

Str.Pacii, nr. 34

Vaslui

Iasi





editdelete



To set auto value to the #combo_filter you can use:
mygrid.getFilterElement(0).setComboValue(mygrid.cellByIndex(0,0).getValue());
To set default value to the #text_filter you can use:
mygrid.getFilterElement(1).value=mygrid.cellByIndex(0,1).getValue();

As you can see, I used already the syntax

mygrid.getFilterElement(0).setComboValue(“Kokolino Bombilici”);

Can you see that in the first post… !!!

and IT’S NOT WORKING!!!

WE HAVE A REGISTERED VERSION!!!

PLEASE, GIVE ME THE PROPER HELP, NOT JUST COPY/PASTE from documentation…

Where I have to put the syntax

mygrid.getFilterElement(0).setComboValue(mygrid.cellByIndex(0,0).getValue());

After or before mygrid.init()??? In what function …!!!

What I have to include in … ???




>>mygrid.getFilterElement(0).setComboValue(“Kokolino Bombilici”);


This syntax works well. You shoudl call getFilterElement method after all rows was loaded:


mygrid.attachEvent(“onXLE”,function(){
mygrid.getFilterElement(0).setComboValue(“Kokolino Bombilici”);
mygrid.getFilterElement(1).value=“Str.Pacii”;
});
Working sample will be send you by email



mygrid.attachEvent(�onXLE�,function(){


               
grid.getFilterElement(index).setComboValue(value);



});






This one? It is not working, also. I have maybe to include something, or what… ???



There right syntax is:


mygrid.attachEvent(�onXLE�,function(){

mygrid.getFilterElement(index).setComboValue(value);

});




>>It is not working, also


Please descripbe how doesn’t it work. Does your browser return any errors?

When I use that syntax, all my combo filters is without any options, without pre-defined values, they are blank… and that’s all


Try to use following code:


mygrid.attachEvent(“onXLE”,function(){
mygrid.getFilterElement(0).enableFilteringMode(false);
mygrid.getFilterElement(0).setComboValue(“Kokolino Bombilici”);
});





sample_combo_filter_.zip (1.25 KB)

The script which you’ve sended me is not working for me… I just sended you an email on support@dhtmlx.com with some details about this, please answer me asap… Thanks

It seems you are using old version of dhtmlxgrid_filter.js file. You page returns error:
mygrid.getFilterElement is not a function
…/test/combo_filter.html
Line 23

It means that getFilterElement method is not defined.



New version of dhtmlxgrid_filter.js was send you by email

Hi again,

I overwrited the file dhtmlxgrid_filter.js and as you
can see in the attached image, is just partly working now… The auto
values is there, but the filter is not working…


        mygrid.attachEvent(“onXLE”,function(){
           
            mygrid.getFilterElement(0).enableFilteringMode(false);

            mygrid.getFilterElement(0).setComboValue(“Kokolino Bombilici”);

            mygrid.getFilterElement(1).value = “stefan”;           
            //mygrid.getFilterElement(1).value=mygrid.cellByIndex(0,1).getValue();
            //mygrid.filterByAll();
        });    


Any ideeas.. ??

Thanks..