Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 1.17 KB

result.withdata.md

File metadata and controls

46 lines (36 loc) · 1.17 KB

Result.withdata

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.

Sample

var result = new Result();
result
.runat("#table1")
.remove("tr")
.append("&lt;tr>&lt;td>{data1}&lt;/td>&lt;td>{{data2}}<&lt;/td>&lt;/tr>")
.withdata([
	{"data1":"hellworld1", "data2":"&lt;span style='color:greed'>OK&lt;/span>"},
	{"data1":"hellworld2", "data2":"&lt;span style='color:red'>NG&lt;/span>"},
])
.runat("body")
.withdata(
	{ "#text1":"good morning","#text2":"good day" }
);

API

CallingReturning
Result . withdata ( data )Result
ParametersTypeDescription
dataArray|ObjectThe 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.
//as an array
[{maskkey1:value1, maskkey2]:value2 ...},{...}]

//as an object
{selector1:value1, selector2:value2 }