Using on Key Down (Enter key) to filter the grid?

Rebecca shared this question 5 years ago
Answered

I'm trying to create an interaction for the Enter key on a grid filter (search). I've seen the video http://www.justinmind.com/support/how-to-simulate-searches-in-a-data-list-in-your-web-prototypes-single-criteria/ Clicking the search "button" works right. However, I also want the search to run after hitting the Enter key (like a normal search). I did everything the same as the button (set value > calculated > filter conditions [grid, search textbox]), except I used the "on Key Down" event. Yet, when I type in my search terms into the textbox and hit Enter, I get [object object] in the search box. What am I doing wrong?

Comments (4)

photo
1

Could you verify that the target of your set value action is the data grid? It looks like the event is changing the value of the search box instead.

photo
1

Oops, I did have the search box as the changing value - so I updated the condition to set the value of the grid and it worked great. Thanks for the fast response!


One more question - I have a datacount on the grid records returned and I want to display "No matching records" if no rows are returned. I tried an "on change" event to "show" a label if the datacount = 0, but the label still isn't showing. Any suggestions?

photo
1

I think I need a bit more of information. What element has the 'on change' event defined?

photo
1

I figured it out - I had the label inside a row of the grid, so when the grid didn't have any results, it hid my label as well.


In case anyone else wants to have a "No matching results" label appear if the grid is empty, I created an 'on Change' event on the search box, set the action to "Show" the label, and added a condition "when [count(mygrid) = 0]".