Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    OperationID for update operation in ListGrid

    Hi All,

    I am using nightly build of smartclient 8.0 (will just switch to release version soon) and i want to define operationID for update operation in list grid.

    Basically I have one RestDataSource that is shared among two listgrid and both listgrid allow inline editing. Now i want to call different different URL of server on update operation initiated by both listgird. I know that i can define multiple same operation type using operationID and i am using it as well.

    Is there a way i can define operationID for update operation in listgrid (like update operation accept requestProperties but i was unable to find how to do it in listgrid)

    Thanks for support,
    Argopm

    #2
    Set listGrid.updateOperation.

    Comment


      #3
      Thanks for the reply.

      I tried below:
      List grid
      Code:
      isc.ListGrid.create({ID:"matchedResultLG",
      	dataSource:"ApsDS",
      updateOperation:'changeClassTypeOfResult'
      ......)};
      and datasource code is:

      Code:
      isc.RestDataSource.create({
      ID:"ApsDS",
      
      recordXPath:"//ApsDS",
      sendMetaData:true,
      metaDataPrefix:"",
      operationBindings: [{operationType:"update", dataProtocol:"postParams",dataURL:"./classificationControllerChangeScanClassType.htm"},
      		    {operationType:"update", operationId:"changeClassTypeOfResult", dataProtocol:"postParams",dataURL:"./classificationControllerChangeScanClassType.htm"}]
             
      .......  
      }  );
      but no luck. Please guide me to know what i am doing wrong.

      Comment


        #4
        Those two operationBindings declare the same dataURL.

        Comment


          #5
          Sorry that was my mistake, I changed the URL before posting and actually it is:

          Code:
          [
          {operationType:"update", dataProtocol:"postParams",dataURL:"./classificationControllerChangeWrlsScanClassType.htm"},
          		    {operationType:"update", operationId:"changeClassTypeOfMatchedScanResult", dataProtocol:"postParams",dataURL:"./classificationControllerChangeMatchedScanClassType.htm"}
                 
              ]
          Thanks.

          Comment


            #6
            Then clarify "no luck". What you've done changes the URL for "update" operations for the grid. Note that ListGrids also issue "add" operations when adding new records.

            Comment


              #7
              I am only using inline edit operation via listgrid and add/delete is not used. However i have used fetched operation with operation id but that is being invoked something like

              Code:
              matchedScanResultLG.fetchData(null,null,{operationType:"getMatchedScanResults"});
              And it is working but no luck with update operation as it is triggered automatically and i am triggering fetch on tab selection so can control that.

              Any more idea of what can be done?

              Comment


                #8
                The feature appears to be working fine for everyone. Look for typos and other basic errors and work toward a standalone test case.

                Comment


                  #9
                  Sorry for the typo, that is operationId not operationType.

                  Comment


                    #10
                    Finally I got success by overriding transformRequest method of RestDataSource as mentioned below:

                    Code:
                     transformRequest : function (dsRequest) {
                             if (dsRequest.operationType == "update" && dsRequest.componentId=="matchedScanResultLG") {
                                 
                                 // combine paging parameters with criteria
                                 dsRequest.operationId="changeClassTypeOfMatchedScanResult";
                    			return this.Super("transformRequest", dsRequest);
                    			}
                    			else return this.Super("transformRequest", dsRequest);
                             },

                    Comment

                    Working...
                    X