Please find below my grid view :
CellPadding="4" ShowFooter="True"
DataKeyNames="TimesheetId" Width="700px"
onsorting="ExpensesGridView_Sorting" CssClass="Gvplacement">
Approve:
CommandName="Approve" />
As I am new to jquery,I am not able to get the buttonId.
I have to create a jquery function which will be called when we click the image button.
Purpose of the function:
Check if any check box is selected and if so , an alert message has to be displayed.
Resmi SatishPosted Jul 9, 2013, 5:59 AM
Note:
appBtn is the css class name assigned to the button
Gvplacement is the css class name assigned to the gridview.
Iftikar HussainPosted Jul 4, 2013, 8:16 AM
Modify your javascript as shown below
and in your grid
Regards,
Iftikar
Resmi SatishPosted Jul 4, 2013, 7:56 AM
function fReceiptExists() {
var totalreceiptcount;
var len = $("input:checkbox:checked").length;
if (len == 0) {
alert("Please select any timesheet for approval");
return false;
}
else {
$('#<%=ExpensesGridView.ClientID%>').each(function() {
if ($(this).find('input:checkbox').attr("checked")) {
alert('inseide');
totalreceiptcount += parseInt($(this).find('input:text[id$="lblReceiptCount"]').attr("value"));
alert(totalreceiptcount);
}
});
return true;
}
}
Iftikar HussainPosted Jul 4, 2013, 7:39 AM
Regards,
Iftikar
Resmi SatishPosted Jul 4, 2013, 7:33 AM
Now I am able to check whether check box are selected or not.
I have to find the sum of label controls for which the check box are selected .
I tried using .each function but some error was throwing.
Iftikar HussainPosted Jul 4, 2013, 6:29 AM
You can do this by like below
Modify the ImageButton to call javascript method
Regards,
Iftikar