How to use an inline select, (no client side updating required).

How to use an inline select, (no client side updating required).

xesionprincexesionprince Posts: 12Questions: 0Answers: 0
edited September 2013 in Plug-ins
I have an mvc 4 asp.net project. In my view I currently have a hardcoded select with the options being filled from the Viewbag.

I need every row of the table to be able recognise this select, so that even after scrolling/paging etc I can still click on a select and have JQuery copy the selected text to a label elsewhere in my view.

So far, after much research, I have this in my JQuery file:

$('#assignmentSelection').editable("/ClassificationAssignments/UpdateField",
{
type: 'select',
loadurl: '/ClassificationAssignments/Assignments',
loadtype: 'GET',
loaddata: { type: "1" }
});

and in my _Layout.vbhtml view I have a reference to Jeditable by Mika Tuupola, version 1.7.1, along with a reference to
DataTables 1.9.4

This is the current drop down markup for the third column of my table:



@For Each choice As SelectListItem In ViewBag.assignmentChoices
@If row.ClassificationChoice Is Nothing Then
@ Not Assigned
Else
If choice.Text = ViewBag.selectedValue Then
@@choice.Text
Else
@@choice.Text
End If
End If
Next



I've tried everywhere for help on this, but just can't find out how to modify my application architecture to allow an inline select on every row -
(not just the rows that are only visible in the scrollable area.)

I have a hunch that I need to add a function in fnDrawCallback, I currently have:

"fnDrawCallback": function () {

$('#assignments tbody tr').each(function () {
// ????
}); // end $('#assignments tbody tr').each(function () {

but what if anything? to put in here?

Do I even need the editable plug in for my scanario ?
This discussion has been closed.