title: How to retrieve fields value from Kendo Grid Models using ColdFusion
body: <p>How can I get posted field values from a Kendo model on the server end? I have a logger on the server end. This shows I received all of the fields, with column names and values. However, I am not sure how to retrieve those values:</p>
  
  <p><strong>Used Script:</strong></p>
  
  <pre><code> &lt;script&gt;
                  $(document).ready(function () {
                      var crudServiceBaseUrl = "http://localhost:8500/test/test1.cfc?method=",
                          dataSource = new kendo.data.DataSource({
                              transport: {
                                  read:  {
                                      url: crudServiceBaseUrl+"JsonRead",
                                      dataType: "json"                                    
                                  },
                                  create: {
                                      url: crudServiceBaseUrl+"JsonCreate",
                                      dataType: "json"
                                  },
                                   parameterMap: function(options, operation) {
                                      if (operation !== "read" &amp;&amp; options.models) {
                                          return {models: kendo.stringify(options.models)};
                                      }
                                      return options;
                                  }
                              },
                              batch: true,
                              pageSize: 20,
                              schema: {
                                  type: "json",
                                  model: {
                                      id: "productid",
                                      fields: {
                                          productid: { editable: false, nullable: true },
                                          productname: { validation: { required: true } },
                                          unitprice: { type: "number", validation: { required: true, min: 1} },
                                          discontinued: { type: "boolean" },
                                          unitsinstock: { type: "number", validation: { min: 0, required: true } }
                                      }
                                  }
                              }
                          });
  
                      $("#grid").kendoGrid({
                          dataSource: dataSource,
                          pageable: true,
                          height: 430,
                          toolbar: ["create"],
                          columns: [
                              "productname",
                              { field: "unitprice", title: "Unit Price", format: "{0:c}", width: "100px" },
                              { field: "unitsinstock", title:"Units In Stock", width: "100px" },
                              { field: "discontinued", width: "100px" },
                              { command: ["edit", "destroy"], title: "&amp;nbsp;", width: "172px" }],
                          editable: "inline"
                      });
                  });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>test1.cfc</strong></p>
  
  <pre><code>    &lt;cfcomponent&gt;
  &lt;cffunction name="init"&gt;
  &lt;cfreturn this&gt;
  &lt;/cffunction&gt;
  
  &lt;cffunction name="JsonRead" returntype="any" description="Return all Product" access="remote"&gt;  
   &lt;cfquery name="getallproducts" datasource="DataSource"&gt;       
       SELECT * from Products
      &lt;/cfquery&gt;
  
      &lt;cfset var aTmp = arraynew(1)&gt;     
      &lt;cfif getallproducts.recordcount&gt;     
          &lt;cfloop query="getallproducts"&gt; 
              &lt;cfset stTmp = structNew()&gt; 
              &lt;cfloop list="#lcase(getallproducts.columnlist)#" index="col"&gt; 
              &lt;cfset stTmp[col] = getallproducts[col][currentRow]&gt; 
              &lt;/cfloop&gt;
              &lt;cfset arrayAppend(aTmp,stTmp)&gt; 
          &lt;/cfloop&gt; 
       &lt;cfelse&gt; 
          &lt;cfset stTmp = structNew()&gt; 
              &lt;cfloop list="#lcase(getallproducts.columnlist)#" index="col"&gt; 
                  &lt;cfset stTmp[col] = ""&gt; 
              &lt;/cfloop&gt;      
              &lt;cfset arrayAppend(aTmp,stTmp)&gt; 
       &lt;/cfif&gt; 
  
    &lt;cfset ss=#SerializeJSON(aTmp)#&gt;
  
      &lt;cfreturn ss&gt;
  
  &lt;/cffunction&gt;
  
  &lt;cffunction name="JsonCreate" returntype="void" description="Create New Row" access="remote"&gt;   
              &lt;cfargument name="models" type="string" required="yes"&gt;           
              &lt;cfset data = urldecode(arguments.models)&gt;
              &lt;cfset data = deserializeJSON(data, false)&gt;
  &lt;/cffunction&gt;
  
  
  &lt;/cfcomponent&gt;
  </code></pre>