Add extra buttons to NeoTable fixed-table-toolbar - Forum

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

Add extra buttons to NeoTable fixed-table-toolbar

I have created a table for use in an app on a mobile device and wish to clear any Search with a single button click, currently the only way I can see to clear the text in the search input is to click within the Search box and BaceSpace.

I have created a Clear button and added to the page, which works okay but depending on screen size or oriantation, it can be unpridictable on where the button gets positioned on screen. Not sure if this is the best soloution but it does work using the actions as seen below.

.....Add Watch to check if search active.....
Watch  [neoTableSearch] "TableSearch"

.....Sub Routine "TableSearch" to show a CLEAR button when text entered and hide if input is manually cleared.....
If [neoTableEvent] == "search"
      ShowObject "SVGicon2" "none" 0
      If [neoTableSearch] == ""
         HideObject "SVGicon2" "" 0
      EndIf
Else
EndIf

.....If CLEAR button is pressed, button hides and the table is initialised again to clear the search.....
HideObject "SVGicon2" "" 0
neoTableInitTable "ViewsContainer" "" [rows] "Table" false true false true false "OnTableClick"
neoTableLoadData "ViewsContainer" [mydata]
  • Firstly, is this the best way to achive what I'm after?
  • Secondly, is there any way it would be possible to add the Clear button to the NeoTable fixed-table-toolbar and achive the same result?

Please see the image for where the button is placed currently (a bit hit and miss) and where it would be far better to place it, with the other action buttons within the fixed-table-toolbar.

Any help appreciated.

Thanks.

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