DataTables Editor: Select2 Plugin - ?initialValue:true&value=%22%22 should not be sent for a create.
DataTables Editor: Select2 Plugin - ?initialValue:true&value=%22%22 should not be sent for a create.

If I understand correctly, when the editor opens (edit event, not create), we must essentially go ask the server for the dropdown item given a specific Id.
On a create however, this should not be the case. In fact, during a create this is what is fired off:
http://localhost:53112/api/Contacts?initialValue=true&value=%22%22
This means, I have to add additional code to my server to handle a blank value, even though we are saying "initialValue=true". Whats more, I am using a rest API and I really wish I could just do http://localhost:53112/api/Contacts/1234
How can we get the plugin updated to remedy this? Can I override this?
This question has an accepted answers - jump to answer
Answers
Additionally, Each of my rows already contains the data desired by needAjax. IE each row has Contact and ContactId. Ideally, I would like to tap into the data I already have.
Sorry to keep dumping text here, but I have started to modify the select plugin to work for my special cases and I noticed set: does not give me the full row data, only the val. Why is this? How do I take what I have (conf and val) and get the table row from this?
EDIT because I cannot delete. Define field.data and that will become val giving you access to everything needed.. I will post here shortly with my solution.
Solution:
Replace the ajax call if(needAjax) with this:
To use it, make sure your field has "data" defined, and also on fields define the following:
This function lets you build the option object { id: .., text:.. } with whatever data from "data". So if your data is in the row, you have full control over how it is displayed. Not yet tested with multiple.
Unless of course you have a default value defined, in which case you absolutely would need this.
This sounds like one of those cases where it is useful to modify the code to suit your needs
.
Allan
wrong post, sorry