Welcome Guest Search | Active Topics | Sign In | Register

Grid and filtering with Javascript Options
John Foley
Posted: Friday, August 20, 2010 3:02:47 PM
Rank: Member
Groups: Member

Joined: 9/6/2008
Posts: 29
Hi,

I am using the grid control on my page and I want to allow my users to filter the items of the grid based on a "filter". I'd like to do all of this on the client side with javascript but I'm not sure if what I'm going to want to do is possible.

I have looked over the client API and have figured out how I can delete the items based on the text that is typed in by the user. What I'd like to do is be able to "undelete" them if the user hits the backspace and clears out their filter. Is it possible to do this? I know the control keeps the item in it's Grid Collection so I was wondering if it is possible to undelete items.

Solution 2:, if that isn't possible, I thought I could possibly just hide the items that don't match their filter and then if they clear out the filter, I can just show them again. I saw where I can manipulate the style on the cell, but it wouldn't allow me to do it for the item (row) itself. Is that possible?

Solution 3: My last thought was that I could create a hidden column and if the data matches, I can enter in a 1 (or 0 if it doesn't) and then sort by that column so the ones that match appear at the top, then i can just highlight a cell with the style to show which ones match. In order to get this solution to work well though, I would have to make the grid sort by this hidden column on the client side. Is there a way to change the sort column with javascript?

Thanks for any information you can provide me!

Thanks,
Jonathan
eo_support
Posted: Friday, August 20, 2010 3:24:23 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

There is no way to do that on the client side. The key feature that is missing is the "undelete" feature. The Grid needs you to explicitly "delete" an item in order to hide it (otherwise it wouldn't know that it needs to skip that row while it computes layout), so hiding row with only CSS will not work. Once you explicitly delete an item, the item is still there but there is no public interface to bring it back visible. As such the only way to "undelete" item is to do a refresh on the server side.

Thanks!
John Foley
Posted: Friday, August 20, 2010 3:33:25 PM
Rank: Member
Groups: Member

Joined: 9/6/2008
Posts: 29
Do you think that any of the three options could be considered for future builds? I would imagine that many other users would benefit from a client side filtering option, but I could be wrong. If the undelete option is not feasible, I think that being able to apply css to a row (display:none) would work just as well because then the grid wouldn't lose access to the item and the style can then easly be switched back if the filter is cleared out.

For now, I will re-draw the grid if they clear it out, but it would be nice to be able to do this on the client side.

Thanks,
Jonathan
eo_support
Posted: Friday, August 20, 2010 3:52:50 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Yes. I understand where you come from. I think the most feasible approach is to implement an "undelete" feature. Applying CSS is not feasible because that can turn a row visible/invisible without going through the Grid. In any case, we will add this into our list and update this thread again if we do implement anything on this.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.