Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Latest commit

 

History

History
45 lines (36 loc) · 1.17 KB

result.withdata.md

File metadata and controls

45 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("<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" }
	);

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 }