jQuery Datatables not working properly -


I have a table that fills through Knockout.js and jQuery Datatables 1.9 on the table for sorting and paging Uses .x

  & lt; Table id = "myTasks-table" class = "table-table-border table-striped request-table" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th & gt; Request ID & lt; / Th & gt; & Lt; Th & gt; & Lt; / Th & gt; & Lt; Th & gt; Follow up & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tbody data-bind = "foreach: myTasksVM.tasks" & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt ;! - ko if: RequestSource == "I" - & gt; & Lt; A data-bind = "entry: {href: '/ helpdesk / ticket / description / service service}" & gt; & Lt; Span data-bind = "text: service royved" & gt; & Lt; / Span & gt; & Lt; / A & gt; & Lt ;! - / ko - & gt; & Lt ;! - ko if: RequestSource! = "I" - & gt; & Lt; A Data-Bind = "Att: {href: '/ Customer Service / Service Service / Details /' Service Service}" & gt; & Lt; Span data-bind = "text: service royved" & gt; & Lt; / Span & gt; & Lt; / A & gt; & Lt ;! - / ko - & gt; & Lt; / TD & gt; & Lt; Td data-bind = "text: request type" & gt; & Lt; / Td> & Lt; Td data-bind = "text: outputdate (follow-up date)" & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt;   

JS has been used to fill the table:

  var dtOptions = {"sDom": "lt; 'line' & lt; 'Span6' & lt; 'dt_actions' & gt; L & gt; & lt;' span6'f & gt; R & T; T & lt; Line '& lt;' Span6'i> 
"," sPaginationType ":" Bootstrap "," IDisplayLength ": 10}; Var VisualModel = {MyTsxMM: New My Task Viewdown ()}; MyTasksViewModel () {var itself = this; Self.tasks = ko.observableArray ([]); $ Ajax ('async': wrong, 'url': '/ api / customerservice / servicereequestListView / GetByEmployee /' + userId, 'datatype': 'text jason', 'type': 'gET', 'success': function (jsn ) {If (json! == null} {self.tasks (json); table = $ ('request-table'). Datoptions;}}}); }

The interesting thing about this is that when the total # rows are listed at the bottom of the page, it shows 1 out of 1, but there are at least 30 items in the list Are the list The search does not work either. When I start typing, everything disappears This same method of making tables is used in many other areas without any problem. What could be wrong on this page? I am feeling that this is something stupid that I do not see.

Update : I tried to upgrade to 1.10 and still have a problem.

About the data: You are describing the behavior of a statistic, the initial set of rows (Potentially empty), and new changes have not been detected.

If you want to modify the contents of an existing datatable, then you should use the API functions fnAddData / fnUpdate / fnDeleteRow (API 1.9, if you are using the new version 1.10 See the official docs).

& lt; Table & gt; will not modify the node.

Another possibility is to destroy and recreate the data on each update:

  $ ('Request-Table'). DataTable () FnDestroy (); $ ('Request table.') DataTable (dtOptions).    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -