title: EXTJS grid store load - adding parameters?
body: <p>I'm in the process on converting an asp repeater into an EXTJS grid. Above the repeater is a dropdown and a radiobutton list. The dropdown selects which clients' data the repeater shows, and the radiobuttonlist selects the query type (default, resource, or role). Currently, when the ddl or radiobutton is changed, the page postsback with the new data.</p>
  
  <p>I'm not sure how to pass the value of these two objects into my static webservice on the backend via the extjs store api GET call.</p>
  
  <p>The extjs store code...</p>
  
  <pre><code>store: Ext.create('Ext.data.Store', {
                      autoLoad: true,
                      autoSync: false,
                      model: 'Assembly',
                      proxy: {
                          type: 'ajax',
                          headers: { "Content-Type": 'application/json' },
                          api: {
                              read: '/Admin/BillRateData.aspx/Get'
                          },
                          reader: {
                              type: 'json',
                              root: function (o) {
                                  if (o.d) {
                                      return o.d;
                                  } else {
                                      return o.children;
                                  }
                              }
                          },
                          writer: {
                              type: 'json',
                              root: 'jsonData',
                              encode: false,
                              allowSingle: false
                          },
                          listeners: {
                              exception: function (proxy, response, operation) {
                                  Ext.MessageBox.show({
                                      title: "Workflow Groups Error",
                                      msg: operation.action + ' Operation Failed: ' + operation.getError().statusText,
                                      icon: Ext.MessageBox.ERROR,
                                      buttons: Ext.Msg.OK
                                  });
                              }
                          }
                      }
  </code></pre>
  
  <p>And the webservice...(with some psuedocode)</p>
  
  <pre><code>[WebMethod]
      [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
      public static List&lt;BillRate&gt; Get()
      {
          using (TimEntities db = new TimEntities())
          {
              int tableId = Int32.Parse(ddlTable.SelectedValue);
  
              var defaultQry = from t1 in db.BillCostTableDatas
                               where t1.TableId == tableId
                               &amp;&amp; t1.ResourceId == 0 &amp;&amp; t1.RoleId == 0
                               orderby t1.Rate
                               select new
                               {
                                   id = t1.Id,
                                   resource = "",
                                   role = "",
                                   rate = t1.Rate,
                                   TierName = ""
                               };
  
              var resourceQry = from t1 in db.BillCostTableDatas
                                join t2 in db.Machines on t1.ResourceId equals t2.Machine_ID
                                join t3 in db.TOMIS_USER on t2.Machine_User_ID equals t3.User_ID
                                join t4 in db.PricingTierNames on t1.PricingTierID equals t4.TierID
                                where t1.TableId == tableId
                                  &amp;&amp; t1.ResourceId != 0
                                  &amp;&amp; t1.RoleId == 0
                                orderby t3.LName, t3.FName, t1.Rate, t4.TierName
                                select new
                                {
                                    id = t1.Id,
                                    resource = t3.LName + ", " + t3.FName,
                                    role = "",
                                    rate = t1.Rate,
                                    TierName = t4.TierName
                                };
  
              var roleQry = from t1 in db.BillCostTableDatas
                            join t2 in db.TaskRoles on t1.RoleId equals t2.Id
                            where t1.TableId == tableId
                            &amp;&amp; t1.ResourceId == 2 &amp;&amp; t1.RoleId != 0
                            orderby t2.Name, t1.Rate
                            select new
                            {
                                id = t1.Id,
                                resource = "",
                                role = t2.Name,
                                rate = t1.Rate,
                                TierName = ""
                            };
  
              if (this.rblOptions.SelectedValue == "resource")
              {
                  var results = from Res in resourceQry.ToList()
                                select new BillRate
                                {
  
                                };
                  return results.ToList();
              }
              else if (this.rblOptions.SelectedValue == "role")
              {
                  var results = from Res in roleQry.ToList()
                                select new BillRate
                                {
  
                                };
                  return results.ToList();
              }
              else
              {
                  var results = from Res in defaultQry.ToList()
                                select new BillRate
                                {
  
                                };
                  return results.ToList();
              }
  
              return null;
          }
      }
  </code></pre>