The withdata function is established to create the withdata attribute to the last return value. It can be called as far as once to a runat. The second calling is invalidated without any exceptions.
var result = new Result(); result .runat("#table1") .remove("tr") .append("<tr><td>{data1}</td><td>{{data2}}<</td></tr>") .withdata([ {"data1":"hellworld1", "data2":"<span style='color:greed'>OK</span>"}, {"data1":"hellworld2", "data2":"<span style='color:red'>NG</span>"}, ]) .runat("body") .withdata( { "#text1":"good morning","#text2":"good day" } );
Calling | Returning |
---|---|
Result . withdata ( data ) | Result |
Parameters | Type | Description |
---|---|---|
data | Array|Object | The data which will be shown at the web. Tf with the append attribute, the withdata attribute must be an array. Or it can be an object.
|