DataTables Inline Editor select does not maintain selected value

DataTables Inline Editor select does not maintain selected value

netcogroupnetcogroup Posts: 4Questions: 1Answers: 0

Dear,

We are having same problem like the one mentioned in the https://datatables.net/forums/discussion/31210/datatables-inline-editor-select-does-not-select-current-value-or-submit-first-value. Can you please send us the fixed .js files.

Basically select combo doesn't maintain the selected value and instead when we click it for editing combo box always initialized and select first value instead of the selected one.

An early reply will be helpful.

Answers

  • allanallan Posts: 46,595Questions: 1Answers: 6,507 Site admin

    The bug mentioned in that thread was fixed in Editor 1.5.3. 1.6.5 is the current release and I'm not aware of that issue being present in the current version.

    Can you show me your Editor configuration and also the JSON being sent by the server please? Even better would be if you can link to a page showing the issue.

    Allan

  • netcogroupnetcogroup Posts: 4Questions: 1Answers: 0
    edited December 2017

    Dear Allan,

    Thanks for your quick reply. Following are the details.

    ReqEditor = new $.fn.dataTable.Editor( {                
                    table: "#reqTable",
                    fields: [ 
                        {
                            type:"readonly",
                            label: "Line:",
                            name: "Line"
                        },
                              {
                        type:  "select",
                        label: "UOM:",
                        name: "UOM",
                        ipOpts:uomList    
                      
                    },        
                    ],
                    formOptions: {
                        inline: {
                            onBlur: 'submit',
                            // onChange:'submit'
                        }
                    }
                } );
    

    JSON

     if(typeofList=="uom"){                
                            for (var i = 0; i < data.d.length; i++) {
                                uomList[i] = { "label":data.d[i].Category , "value": data.d[i].Categoryid };
                            }
                        } 
    data.d[i].Category is simply string
    

    Also when we focus out from the drop down it shows the "value" (e.g., 63), instead of the Label value

    Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • allanallan Posts: 46,595Questions: 1Answers: 6,507 Site admin

    Also when we focus out from the drop down it shows the "value" (e.g., 63), instead of the Label value

    I suspect this and the other are related. Certainly this one is because you are not Ajax submitting the edited data - thus no "joined" information is being loaded.

    Does the value of data.d[i].Categoryid in the options list match the values of UOM in the data set? If you could show me that information (i.e. the actual data) that would be useful.

    Allan

  • netcogroupnetcogroup Posts: 4Questions: 1Answers: 0

    thanks Allan.

    No, we are submitting via Ajax (there is an action button at row end).

    Anyways, I have sent the URL and other details in a direct message to you. Kindly keep it safe.

    Best regards.

  • allanallan Posts: 46,595Questions: 1Answers: 6,507 Site admin

    No, we are submitting via Ajax

    You are - but not via the Editor ajax option (at least it isn't shown above).

    Allan

  • farrukhzfarrukhz Posts: 1Questions: 0Answers: 0

    thanks Allan.
    issue is not in submitting the data..submission process is fine.
    issue is that when we focus/click the drop down,it goes to its initial state regardless of what already selected.
    secondly when we focus out from the drop down , it displays the "selected value" instead of showing the "selected text".
    we have send you the URL and a screenshot Kindly check it their.
    Best regards

  • allanallan Posts: 46,595Questions: 1Answers: 6,507 Site admin

    I've added a reply to your PM. Perhaps we should continue the discussion there.

    Allan

  • netcogroupnetcogroup Posts: 4Questions: 1Answers: 0

    Dear Allan,

    We have moved a bit. However, focus problem is still there. As soon as we click the column it shows/select value from column. And when focus move to other column it reset to the value which was the actual value of the column

    You can check the URL (credentials are same as it was before):

    (kindly look at Item type column).

    e.g., in above example, values are Repaired and Used, now if you click any of these, it show you by default "new" and when focus gets out (despite whatever user selected), it reset to original value that was bind first time to grid.

    Can you please guide in this regard?

    Best regards,

Sign In or Register to comment.