Facing the issue in edit fields is not updating?

Facing the issue in edit fields is not updating?

saidulusaidulu Posts: 8Questions: 6Answers: 0

Hi ,

we are using fixed columns in my application. So,we are using key-table for inline editing, while edit the field,unable to updating,so i checked fixed columns example in data table also,but its not working,so can you please replicate the issue.
I'm attaching the link. Please take a look and give us some suggestions for updating the value while editing.

https://editor.datatables.net/examples/inline-editing/fixedcolumns.html

Answers

  • colincolin Posts: 3,646Questions: 0Answers: 643

    Hi @saidulu ,

    It would be worth running the debugger on the page to ensure the components are present. If that doesn't help or give any clues, could you provide a link to your page please so we can take a look,

    Cheers,

    Colin

  • saidulusaidulu Posts: 8Questions: 6Answers: 0

    Hi @ colin ,
    I created a test case regarding the issue for fixed columns.

    Please go through the steps below to replicate the issue:
    --> Run this code in .
    -->Select Date2 field try to update it to any date and click outside of the table.
    --> the field is not updating.
    Please go through this updated link @colin

    http://live.datatables.net/diyariwa/22/edit

    Thanks,
    Saidulu.

  • allanallan Posts: 48,908Questions: 1Answers: 7,131 Site admin

    For the Date2 column in the table you have:

                {
                    "data" : function(row, type, val, meta) {
                        return new Date();
                    },
                    "className" : "inlineEditable",
                    "editField" : "Date2"
                }
    

    That means that every time DataTables requests the data for that cell a new Date() object will be returned and rendered into the document (which it why you are getting the full date string).

    You'll notice that when you edit the field the table does update - with the current time.

    I would strongly suggest against using columns.data as a function. Instead use the Date2 property in your data set.

    Allan

Sign In or Register to comment.