This is a migrated thread and some comments may be shown as answers.

[Solved] Trying to implement MVC Grid with ability to select all checkboxes

2 Answers 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jeff
Top achievements
Rank 1
Jeff asked on 30 Sep 2011, 12:16 AM
Hello, I'm trying to use the Telerik grid control. I've followed the demo listed here. I've implemented the code in a very similar fashion with a few changes due to some "quirks". The ID of my checkbox header column is "checkAllMovies"

I've spent most of the day getting it working. I'm now stuck on the part where I want it to select all check boxes. There's a bit of code at the bottom of my "view" file within my form:
@Html.Telerik().ScriptRegistrar().OnDocumentReady(
@<text> 
/* attach event handler to "check all" checkbox */
$('#checkAllMovies').click(function checkAll() 
$("#Grid tbody input:checkbox").attr("checked", this.checked); 
});
</text>);
This doesn't seem to work/do anything. Im relatively new to MVC and very new to the Telerik MVC controls (Open source).

Thanks in advance for any assistance.

-
jboyd

2 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 30 Sep 2011, 07:16 AM
Hello Jeff,

I do not see a reason for this not to work. Is the click handler hit on button click? What is the version of jQuery? Does $("#Grid tbody input:checkbox") selects all checkbox?

All the best,
Nikolay Rusev
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
Jeff
Top achievements
Rank 1
answered on 30 Sep 2011, 03:11 PM
I figured it out: the name of my grid is MoviesGrid but I was refering to just #Grid within the function!!
Tags
Grid
Asked by
Jeff
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or