Searchbuilder buttoned how to fix a constant column ?
Searchbuilder buttoned how to fix a constant column ?
I'm trying to wrap my head around searchBuilder
and its configuration.
In my case i need only a column
to be searched, so i want to be the only column to be auto-selected for every new condition i add
This column in my datas contains strings commas separated.
Since i'm using only that column with searchbuilder how can i autoselect for every new init condition
the only column that is in the list ??
There is an event that i can use to set a default predefined column to be searched on ??
My button is configured this way:
{
extend:'searchBuilder',
className:'btn btn-sm btn-layer1 my-1',
config: {
columns: [3],
preDefined: {
criteria: [
{
data: 'Tags',
condition:'contains'
},
],logic: 'AND'
}
}
}
Replies
Sounds like you want the default condition set to
contains
. Does this example do what you want?Kevin
Unfortunately i already tried that one, it still expect me to pick the column.
What i want to do is to pick automatically the tags column when i add a condition.
As it's done like that it expect still the user to select a column, even when there is only one column to select from.
I see. I don't see an option in the SearchBuilder docs. Maybe an option to sett he default column would be useful. @allan can comment on this. The only thing I can think of is to create an event handler for the SearchBuilder button that selects the desired column. AS an example copy this code into the console of the above linked example:
With only one column set
select.value="0";
.@allan or others may have a better option for you.
Kevin