<?xml version="1.0" encoding="utf-8"?>
<KScriptSetting>
  <Name>dataContext</Name>
  <Description>the dataContext of kview engine, the html render engine of kooboo. You can explicitly set value into datacontext or just declare the value as JS global variable, it will be accesible from kview engine as well. </Description>
  <Example><![CDATA[
    <script engine='kscript'>

    var obj = {name: "myname", fieldtwo: "value"};
    // explicitly set the value. 
    k.dataContext.set("key", obj);
  
    var globalobj = {fieldone: "valueone", fieldtwo: "valuetwo"}; 
  
    </script>

    <div k-content=key.name>
    text will be replaced obj.name.
    </div>

    <div k-content=globalobj.fieldone>
    text will be replaced globalobj.fieldone.
    </div>
    ]]></Example>
  <Props />
  <Methods>
    <Method>
      <Name>set</Name>
      <Description>set function</Description>
      <Example>k.dataContext.set("key", "object or string"); </Example>
      <Params>
        <Param>
          <Name>key</Name>
          <Description>key</Description>
          <Type>string</Type>
        </Param>
        <Param>
          <Name>value</Name>
          <Description>value</Description>
          <Type>object</Type>
        </Param>
      </Params>
    </Method>
    <Method>
      <Name>get</Name>
      <Description>get existing object from dataContext</Description>
      <Example>var value = k.dataContext.get("key"); </Example>
      <Params>
        <Param>
          <Name>key</Name>
          <Description>key</Description>
          <Type>string</Type>
        </Param>
      </Params>
      <ReturnType>object</ReturnType>
    </Method>
  </Methods>
</KScriptSetting>