This question is locked. New answers and comments are not allowed.
Hi,
For a customer I need to have the possibility to hide some rows(like, the user select some rows, and click on the "Hide" button, it's not something which can be based on a filter, its only to help the customer.) He also want a button which "shows all" rows.
How can it be achieved with your library? It's not a big deal if it implies a reload of the page.
For a customer I need to have the possibility to hide some rows(like, the user select some rows, and click on the "Hide" button, it's not something which can be based on a filter, its only to help the customer.) He also want a button which "shows all" rows.
How can it be achieved with your library? It's not a big deal if it implies a reload of the page.
7 Answers, 1 is accepted
0
Hello Julien,
If I understand you correctly, you simpply want to hide rows temporarily, without this affecting the datasource in any way. In this case you should use standard Javascript DOM operations to apply a display:none style (or jQuery hide() method) to the selected rows (e.g. the ones with a t-state-selected CSS class).
Kind regards,
Dimo
the Telerik team
If I understand you correctly, you simpply want to hide rows temporarily, without this affecting the datasource in any way. In this case you should use standard Javascript DOM operations to apply a display:none style (or jQuery hide() method) to the selected rows (e.g. the ones with a t-state-selected CSS class).
Kind regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Julien
Top achievements
Rank 1
answered on 13 Dec 2011, 08:33 AM
Exactly.
But I don't know how to retrieve all selected/unselected rows?
I'm not aware of your t-state-selected
But I don't know how to retrieve all selected/unselected rows?
I'm not aware of your t-state-selected
0
Hi Julien,
The selected rows of the MVC Grid have a t-state-selected CSS class applied to the corresponding <tr> elements. In case you are not aware how to find out all rows with that CSS class with jQuery and hide / show them, please get familiar with the jQuery API, because this knowledge is fundamental and required in order to work easily with our MVC extensions.
var grid = $("#GridID");
$("tr.t-state-selected", grid).hide();
$("tr.t-state-selected", grid).show();
http://demos.telerik.com/aspnet-mvc/grid/selectionclientside
Regards,
Dimo
the Telerik team
The selected rows of the MVC Grid have a t-state-selected CSS class applied to the corresponding <tr> elements. In case you are not aware how to find out all rows with that CSS class with jQuery and hide / show them, please get familiar with the jQuery API, because this knowledge is fundamental and required in order to work easily with our MVC extensions.
var grid = $("#GridID");
$("tr.t-state-selected", grid).hide();
$("tr.t-state-selected", grid).show();
http://demos.telerik.com/aspnet-mvc/grid/selectionclientside
Regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Julien
Top achievements
Rank 1
answered on 13 Dec 2011, 11:16 AM
I've used jQuery before, but I've no idea of the "t-state-selected" class.
This makes me several questions:
-I was thinking that we can select only ONE row, but add combobox on several, is that true?
-Have you a reference somewhere of all this kind of css classes?
-Have you a css style for non-selected rows? Because I need to hide all rows which aren't selected.
This makes me several questions:
-I was thinking that we can select only ONE row, but add combobox on several, is that true?
-Have you a reference somewhere of all this kind of css classes?
-Have you a css style for non-selected rows? Because I need to hide all rows which aren't selected.
0
Hello Julien,
1. Yes, you can select only one row, my mistake. I didn't understand the second part for the question. You can have any content in the Grid cells, e.g. by using templates.
2. I am afraid not. You can inspect the Grid HTML output with Firebug if you need specific information about an element.
3. No, but you can use the jQuery :not() selector to get all rows that don't have the t-state-selected CSS class.
Kind regards,
Dimo
the Telerik team
1. Yes, you can select only one row, my mistake. I didn't understand the second part for the question. You can have any content in the Grid cells, e.g. by using templates.
2. I am afraid not. You can inspect the Grid HTML output with Firebug if you need specific information about an element.
3. No, but you can use the jQuery :not() selector to get all rows that don't have the t-state-selected CSS class.
Kind regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Julien
Top achievements
Rank 1
answered on 13 Dec 2011, 03:31 PM
Okay, then, how can we get all rows which aren't in the "list of checked" item?
0
Marc
Top achievements
Rank 1
answered on 13 Dec 2011, 11:54 PM
You could associate the Checkboxes with an ID and select them with:
Although that will be more of something you perform logic on server side, as you'll likely have to retrieve the associated row data for each entry.
$(".MyCheckBoxClass :not(:selected)")//OR$(".MyCheckBoxClass :not(:checked)")Although that will be more of something you perform logic on server side, as you'll likely have to retrieve the associated row data for each entry.
