Open dbx834 opened 10 years ago
@dbx834 good point, we should be throlling the getData requests from search when in server mode. Unfortunately I am pretty busy at the moment with work, want to submit a PR?
@josebalius Sure, give me a few days. I'll do this on the side.
Hello again,
Please see my fork for a proof of concept. There are three new commits.
Same as above
--------------- Updated variables ------------------
current page - 1
search -
sort field -
sort direction -
page size -
---------------------------------------------------------
--------------- Updated variables ------------------
current page - 1
search - hello
sort field -
sort direction -
page size - 25
---------------------------------------------------------
Now, the search updates on clicking away from the input field rather than on every key press. What do you think?
While working on this update, I noticed there maybe 2 more small features that improve UI experience:
Should I add these 2 before submitting a PR?
@dbx834 I like the two you mentioned there at the end. In terms of when you to update the search, I think I still prefer for it to happen as I am typing but
1) We should have minimum amount of text needed before search happens 2) On every key up, we should set a timeout for like 500ms - 1s (maybe less) and cancel it on every key press, so that if i type a quick word, it won't search till I finish but if I type a partial phrase and stop, the ui can update with the results.
I think all of those would improve the UX. What do you think?
@josebalius good points. Reading your message, I was thinking that different settings may make for different UX. Each UX may be superior in some scenario. It is good if the designer has freedom to configure as s/he pleases and requires.
Perhaps we can work this out like so,
@dbx834 Yep i think the above would work.
Hi,
I'm stoked about React and Angular becoming friends. I've been testing this grid out and it's quite useful. Good work developing it!
I have implemented full server-side 'grid-feeder' api that works with sort, filter and search. All of it comes together beautifully.
I, however, noticed that the search criteria is updated on every key press. Could it be/ is it possible to update the search criteria only after the search field is left?
Updating the grid with local data on every key press is slick but doing that for server data is bit of an over-kill and makes too many http requests. If not for local data, for remote data atleast, onChange/ onBlur update would be an improvement.
To give you an example, if I were to search for 'hello', this is what I would see in the console log in a very quick succession (a few ms after key press) as I was keying in 'hello' -
Configuration
Console log