Pre-populate value in serach Builder

Pre-populate value in serach Builder

Nithin N MNithin N M Posts: 6Questions: 4Answers: 0

1.I need to pre-populate some value in search builder value option even though there is no data in data table
2. I need to load values from database

Answers

  • kthorngrenkthorngren Posts: 21,299Questions: 26Answers: 4,945

    Are you saying you want to get the values, to build predefined Search Builder filters, from the Datatase? If so then use jQuery ajax() to fetch the predefined filter values and initialize Datatables, with these values, in the success function.

    Kevin

  • allanallan Posts: 63,451Questions: 1Answers: 10,465 Site admin

    searchBuilder.preDefined is the property to use to set an initial condition.

    Obviously you can't use the = operator for conditions since that shows a select derived from the data in the table, so there would be no options to select from in an empty table.

    However, you could use contains or any other condition type that uses a input. For example: https://live.datatables.net/kireqami/1/edit .

    Allan

  • Nithin N MNithin N M Posts: 6Questions: 4Answers: 0

    Thank You

Sign In or Register to comment.