javascript - help modding jquery plugin : jsRepeater -
(a template engine for jquery) is that you pass the template engine to the function that the engine finishes Value will be executed before giving it
When I am looping through an array of values, then I would like the formatting function to get the whole array apart from just one value.
How can I modify the formatting function call so that it is a value and an array? I tried to circumvent the code but I could not understand it.
Data example:
var data = {items: [{"file_name": "test1.txt", "file_size": 5000, "bytes_sent": 2500} , {"File_name": "test2.txt", "file_size": 6000, "bytes_sent": 3000}]}; Template example:
& lt; Div & gt; Bytes remaining: $ {file_size: formatRemaining} & lt; / Div & gt; formatting function:
function formatting (data, row) {var balance = data - line [bytes_cent]; Remaining; } In this example I want to compute my formatting function on "File Size" and "Bytes Sent" so that the remaining bytes sent can be output.
I created my own jquery plugin which was exactly what I wanted.
Comments
Post a Comment