Inline editor example is not working at my end

Inline editor example is not working at my end

vimi.ladvimi.lad Posts: 10Questions: 2Answers: 0

Hello Team,

I have created sample example by looking Editor -> Joined tables
https://editor.datatables.net/examples/inline-editing/join.html
in ASP.net
Here is my sample example URL
http://live.datatables.net/huvalima/2/edit

But Edit row is not working..

What am I doing wrong?
When i click on row it shows
"Script error. (line 0)" in consol

And at my end it showing Error
'Cannot read property 'inline' of undefined'

Kindly give resolution.

I want sample Datatble each row editing with asp.net.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @vimi.lad ,

    The sample you posted isn't showing the error reported - the sample is giving this error instead, "Uncaught Unable to find row identifier For more information, please refer to https://datatables.net/tn/14". This is because there isn't a unique identifier for each row - idSrc gives more details. Could you generate the error that you reported in another fiddle?

    Cheers,

    Colin

  • vimi.ladvimi.lad Posts: 10Questions: 2Answers: 0

    Thanks for reply.
    Ok so my JSON is not having DT_RowId variable.

    Cool..
    Now I have added JSon from given example
    https://editor.datatables.net/examples/inline-editing/join.html
    only.

    Here is sample for inline editor
    http://live.datatables.net/huvalima/8/edit

    It is not giving any error but it is showing "No data available in the table".

    You can find data in JSON format in first line of Javascript

    var Data = '{"data": [ {"DT_RowId": "row_1","users": { "first_name": "Quynn", "last_name": "Contreras", "phone": "1-971-977-4681", "site": "1"},"sites": { "name": "Edinburgh"} }, {"DT_RowId": "row_7","users": { "first_name": "Xantha", "last_name": "George", "phone": "1-106-884-4754", "site": "1"},"sites": { "name": "Edinburgh"} }, {"DT_RowId": "row_13","users": { "first_name": "Lael", "last_name": "Kim", "phone": "1-626-697-2194", "site": "1"},"sites": { "name": "Edinburgh"} }, {"DT_RowId": "row_19","users": { "first_name": "Mona", "last_name": "Terry", "phone": "1-443-179-7343", "site": "1"},"sites": { "name": "Edinburgh"} }, {"DT_RowId": "row_25","users": { "first_name": "Ishmael", "last_name": "Crosby", "phone": "1-307-243-2684", "site": "1"},"sites": { "name": "Edinburgh"} }, {"DT_RowId": "row_31","users": { "first_name": "Quinn", "last_name": "Mccall", "phone": "1-808-916-4497", "site": "1"},"sites": { "name": "Edinburgh"} }, {"DT_RowId": "row_2","users": { "first_name": "Kaitlin", "last_name": "Smith", "phone": "1-436-523-6103", "site": "2"},"sites": { "name": "London"} }, {"DT_RowId": "row_8","users": { "first_name": "Bryar", "last_name": "Long", "phone": "1-918-114-8083", "site": "2"},"sites": { "name": "London"} }, {"DT_RowId": "row_14","users": { "first_name": "Lyle", "last_name": "Lewis", "phone": "1-231-793-3520", "site": "2"},"sites": { "name": "London"} }, {"DT_RowId": "row_20","users": { "first_name": "Medge", "last_name": "Patterson", "phone": "1-636-979-0497", "site": "2"},"sites": { "name": "London"} }, {"DT_RowId": "row_26","users": { "first_name": "Quintessa", "last_name": "Pickett", "phone": "1-801-122-7471", "site": "2"},"sites": { "name": "London"} }, {"DT_RowId": "row_32","users": { "first_name": "Alexa", "last_name": "Wilder", "phone": "1-727-307-1997", "site": "2"},"sites": { "name": "London"} }, {"DT_RowId": "row_3","users": { "first_name": "Cruz", "last_name": "Reynolds", "phone": "1-776-102-6352", "site": "3"},"sites": { "name": "Paris"} }, {"DT_RowId": "row_9","users": { "first_name": "Kuame", "last_name": "Wynn", "phone": "1-101-692-4039", "site": "3"},"sites": { "name": "Paris"} }, {"DT_RowId": "row_15","users": { "first_name": "Veronica", "last_name": "Marks", "phone": "1-750-981-6759", "site": "3"},"sites": { "name": "Paris"} }, {"DT_RowId": "row_21","users": { "first_name": "Perry", "last_name": "Gamble", "phone": "1-440-976-9560", "site": "3"},"sites": { "name": "Paris"} }, {"DT_RowId": "row_27","users": { "first_name": "Ifeoma", "last_name": "Mays", "phone": "1-103-883-0962", "site": "3"},"sites": { "name": "Paris"} }, {"DT_RowId": "row_33","users": { "first_name": "Rhonda", "last_name": "Harrell", "phone": "1-934-906-6474", "site": "3"},"sites": { "name": "Paris"} }, {"DT_RowId": "row_4","users": { "first_name": "Sophia", "last_name": "Morris", "phone": "1-463-224-1405", "site": "4"},"sites": { "name": "New York"} }, {"DT_RowId": "row_10","users": { "first_name": "Indigo", "last_name": "Brennan", "phone": "1-756-756-8161", "site": "4"},"sites": { "name": "New York"} }, {"DT_RowId": "row_16","users": { "first_name": "Wynne", "last_name": "Ruiz", "phone": "1-983-744-5362", "site": "4"},"sites": { "name": "New York"} }, {"DT_RowId": "row_22","users": { "first_name": "Pandora", "last_name": "Armstrong", "phone": "1-197-431-4390", "site": "4"},"sites": { "name": "New York"} }, {"DT_RowId": "row_28","users": { "first_name": "Basia", "last_name": "Harrell", "phone": "1-528-238-4178", "site": "4"},"sites": { "name": "New York"} }, {"DT_RowId": "row_34","users": { "first_name": "Jocelyn", "last_name": "England", "phone": "1-826-860-7773", "site": "4"},"sites": { "name": "New York"} }, {"DT_RowId": "row_5","users": { "first_name": "Kamal", "last_name": "Roberson", "phone": "1-134-408-5227", "site": "5"},"sites": { "name": "Singapore"} }, {"DT_RowId": "row_11","users": { "first_name": "Avram", "last_name": "Allison", "phone": "1-751-507-2640", "site": "5"},"sites": { "name": "Singapore"} }, {"DT_RowId": "row_17","users": { "first_name": "Jessica", "last_name": "Bryan", "phone": "1-949-932-6772", "site": "5"},"sites": { "name": "Singapore"} }, {"DT_RowId": "row_23","users": { "first_name": "Pandora", "last_name": "Briggs", "phone": "1-278-288-9221", "site": "5"},"sites": { "name": "Singapore"} }, {"DT_RowId": "row_29","users": { "first_name": "Hamilton", "last_name": "Blackburn", "phone": "1-676-857-1423", "site": "5"},"sites": { "name": "Singapore"} }, {"DT_RowId": "row_35","users": { "first_name": "Vincent", "last_name": "Banks", "phone": "1-225-418-0941", "site": "5"},"sites": { "name": "Singapore"} }, {"DT_RowId": "row_6","users": { "first_name": "Dustin", "last_name": "Rosa", "phone": "1-875-919-3188", "site": "6"},"sites": { "name": "Los Angeles"} }, {"DT_RowId": "row_12","users": { "first_name": "Martha", "last_name": "Burgess", "phone": "1-971-722-1203", "site": "6"},"sites": { "name": "Los Angeles"} }, {"DT_RowId": "row_18","users": { "first_name": "Quinlan", "last_name": "Hyde", "phone": "1-625-664-6072", "site": "6"},"sites": { "name": "Los Angeles"} }, {"DT_RowId": "row_24","users": { "first_name": "Maris", "last_name": "Leblanc", "phone": "1-936-114-2921", "site": "6"},"sites": { "name": "Los Angeles"} }, {"DT_RowId": "row_30","users": { "first_name": "Dexter", "last_name": "Burton", "phone": "1-275-332-8186", "site": "6"},"sites": { "name": "Los Angeles"} }, {"DT_RowId": "row_36","users": { "first_name": "Stewart", "last_name": "Chan", "phone": "1-781-793-2340", "site": "6"},"sites": { "name": "Los Angeles"} }],"options": { "users.site": [{ "label": "Edinburgh", "value": "1"},{ "label": "London", "value": "2"},{ "label": "Los Angeles", "value": "6"},{ "label": "New York", "value": "4"},{ "label": "Paris", "value": "3"},{ "label": "Singapore", "value": "5"} ]},"files": []}';

    can you guide me what is the issue in JSON data so it is not binding to table?

  • kthorngrenkthorngren Posts: 21,309Questions: 26Answers: 4,947

    When using data you need to provide the full path into the variable. It doesn't look for a data object like ajax does. Use this instead data: jsonRes.data,. Here is an updated example:
    http://live.datatables.net/valaxelo/1/edit

    Kevin

  • vimi.ladvimi.lad Posts: 10Questions: 2Answers: 0

    Hi Kthorngner,
    Thanks for reply and resolution. Ok .Now table is binding with data.
    But I also want to bind drop down with data mentioned inside "options" > "users.site"

    How can we bind that? Dropdown 'Location' is not filling with data while editing.
    you can refer sample at
    http://live.datatables.net/valaxelo/2/edit

    Kindly give me solution and also suggest me best way to bind table to achieve all scenarios.

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    You need to use the field().update() method of the select field type. Editor can listen for the xhr event that DataTables triggers, but that's not triggered if you are just loading the data using data.

    editor.field('users.site', data.options['users.site']);
    

    should do it.

    Allan

This discussion has been closed.