neoTable custom search bar - Forum

Forum Navigation
You need to log in to create posts and topics.

neoTable custom search bar

I have a neotable inside my application and I want to make a custom search input for this table with textinput. I like to make a search input which searches each row and then filter them. like the sample of (neotable part1  page permission):

How I can code this textInput?

Uploaded files:
  • You need to login to have access to uploads.

@asmat

I want to make a custom search input for this table with textinput.

Take a look at the code behind the Push Buttons on the page labelled Controlled Views; examples include ...

a) Age=43
b) Age=43 AND LastName=Jolie
c) Age=43 OR Age=61 OR Age=66

Remember that the parameters do not have to be fixed at design time (they could be variables that are populated from the user's entry in TextInput boxes).

I like to make a search input which searches each row and then filter them

If the type of queries above are not sufficient, you can ...

a) Loop through all rows (array items) in your table data ...

b)

-use neoTableGetData to obtain the value of the ID field in each row

-use this ID in neoTablegetRowData to obtain the entire row data

- then do matches of field content against those input by your user

If you need further assistance, please provide an example of your need, with details of field names.

You suppose the below attachment as sample:

Uploaded files:
  • You need to login to have access to uploads.

@asmat take a look at my attached solution.
I have just hidden the neoTable search input field (but it's present).
Then, when something is written into your TextInput object it's sent to the hidden input.
This way you have the exact same result but with your own TextInput

Uploaded files:
  • You need to login to have access to uploads.
asmat has reacted to this post.
asmat

Thank you @luishp, this is a great trick.

I have a few more question about neotable;

How can I get the number rows from a neotable.
How can I get the total number of pages from a neotable in normal status and filtered status?
How can I get the current page from a neotable?

@asmat

How can I get the number rows from a neotable.

Your neoTable data is an array (of JSON objects); so you can use the ArrayLen command to get the number of Array Items (i.e. rows) in the Table Data.

How can I get the total number of pages from a neotable in normal status ?

This can be calculated from the values of 'number of rows' and 'Records per Page' parameter value you specified in the neoTableInitTable command.

How can I get the current page from a neotable?

Whenever the user navigates to a different page, the specified EventManager subroutine is invoked ... as you can see in the neoTable Tutorial Part I ...

If [neoTableEvent] == "pagechange"
   SetVar [thisEventData] "[thisEventData][neoTablePage]"
EndIf

... the reserved variable [neoTablePage] contains the new page number ... you can save it to one of your own variables.

How can I get the total number of pages from a neotable in filtered status?

Currently there is no command (or reserved variable) that provides this information.

 

@luishp - it would be very useful to have a reserved variable e.g. [neoTableFilteredRows] ... and to help developers avoid doing calculations ...

[neoTableTotalRows]
[neoTableTotalPages]
[neoTableFilteredPages]

luishp and asmat have reacted to this post.
luishpasmat