javascript - Dynatable - records are appended to previous list each time the page number is changed -
I am trying to use Dynatable to create a styled list of records from a local JSON dataset. In Dynatable documantions, an example of a stylish list uses the reader function to obtain a record from the DOM, and uses the Writer to generate records in the page. I need to use the local dataset instead of the reader function. Here's the text:
var localJSON = '[{"caption": " myCaption1 ", "thumbnail": "& lt ; IG src = \ '../... Picture / test.jpg \' / & gt; "}, '+' {" caption ":" myCaption1 ", "Thumbnail": "& lt; img src = \ '../ images / test.jpg \' / & gt; }, '+' {"Caption": " myCaption1 ", "thumbnail": " myCaption1 ", "thumbnail": " + Record.caption + '& lt; / Div & gt; & Lt; / Li & gt; '; Retracted; } $ ('# SampleUIList'). Dynatable ({dataset: {perPageDefault: 4, records: records}, authors: {_rowWriter: ulWriter}}); The problem every time I try to change page numbers, or change perPageOptions
, the whole dataset ( localJSON
) is Did I forget something like the previous one (anything like + =
on the record)?
"post-text" itemprop = "text"> You are missing the following configuration parameters:
Table: {BodyRowSelector: 'li'},
This seems to add it to your configuration:
$ ('# sampleUIList'). Dynatable ({Dataset: {PerPageDefault: 4, Records: Records}, Author: {_rowWriter: ulWriter}, Table: {bodyRowSelector: 'li'}});
Should do the trick.
Comments
Post a Comment