Still cannot get drop down list in DataTable to work
Still cannot get drop down list in DataTable to work
xesionprince
Posts: 12Questions: 0Answers: 0
I have the following code:
$('select').change(function (e) {
if (e.srcElement.id == 'clsTitlsForTotUnassign') { // Ignore the drop down on the Classifications page.
return false;
}
var classificationChoice = e.srcElement.value;
if (classificationChoice == 'Not Assigned') {
return false;
}
$('#selectedAssignment').val(classificationChoice);
$('#selectedAssignment').keyup(resizeInput).each(resizeInput); $('#submitRow').show();
$('#submitRow').show();
$('#delSubmitRow').show();
$('#reasonTextarea').focus();
});
but it only works on rows in the datatable that are visible when the page loads.
If I page, sort, or use prev next buttons the event is ignored.
Please, someone help, I've tried on Stackoverflow too, with no response!
$('select').change(function (e) {
if (e.srcElement.id == 'clsTitlsForTotUnassign') { // Ignore the drop down on the Classifications page.
return false;
}
var classificationChoice = e.srcElement.value;
if (classificationChoice == 'Not Assigned') {
return false;
}
$('#selectedAssignment').val(classificationChoice);
$('#selectedAssignment').keyup(resizeInput).each(resizeInput); $('#submitRow').show();
$('#submitRow').show();
$('#delSubmitRow').show();
$('#reasonTextarea').focus();
});
but it only works on rows in the datatable that are visible when the page loads.
If I page, sort, or use prev next buttons the event is ignored.
Please, someone help, I've tried on Stackoverflow too, with no response!
This discussion has been closed.
Replies
In future please link to a test case as noted in the forum rules.
Allan
I've already been to that link and it is no help :(
Allan
Also, 1151 rows are displayed in the datatable.
Anyway, I've sorted this now and it was so simple!
Instead of the nightmare of trying to learn the jEditable api, I simply did this:
@For Each row In _assignments
@
@row.ProductKey
@row.ProductName
@row.InsuranceGroupKey
@row.GroupName
@If row.ClassificationChoice Is Nothing Then
@
Else
@
End If
Next
I can now grab a table row cell content (even after scrolling and paging) without resorting to any editable plug in whatsoever !! ;)