Data rows selected is 0, yet displayed in DataTable.

Data rows selected is 0, yet displayed in DataTable.

Zer0AdminZer0Admin Posts: 6Questions: 2Answers: 0

Greetings,

I am a novice Javascript developer, but dangerous (I can break many things!) SharePoint developer. I am cobbling code together to build a custom SharePoint 2013 input form. The form consists of a dropdown(D1) that displays a server side multi select control (SSMSC) filled with filtered items from D1. The server side control is further monitored for selected items which builds my custom client side Table. The data is fetched via javascript (SPSERVICES) and added to the page via #Table.append(tblrows). This data is cleared with tr.remove() and fetched ANY time there is a change in the server side multi select "selected" box previously mentioned. My dilemma is that when I view the source of the page, I do NOT see the data in the HTML. So when I add a select check box and an alert to tell me what I selected (test purposes), I get 0 rows selected. Interestingly the DataTables stats tell me that "Showing 0 to 0 of 0 entries" in the table. So it is as if I am displaying information not actually in a table I can do anything with.

I cannot provide a link to the page, or the code.
The code will not run in live without the SharePoint list. And I can't cobble an html page since that is part of the problem.

I did use the debugger. The upload code is: upotab

Regards, and thanks for a helpful faceplant in the right direction.

ZeroAdmin

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    You need to use the API in order to add and remove rows to and from the DataTable. See the append FAQ which covers this.

    Allan

  • Zer0AdminZer0Admin Posts: 6Questions: 2Answers: 0

    TY Allan. And it is working superbly.

This discussion has been closed.