1. #1
    Sencha User ThorstenSuckow's Avatar
    Join Date
    Sep 2007
    Location
    Aachen, Germany
    Posts
    597
    Vote Rating
    2
    ThorstenSuckow is on a distinguished road

      0  

    Default Ext.Direct - proposing response for Update/Delete Actions

    Ext.Direct - proposing response for Update/Delete Actions


    Putting ids/data into the data array for a delete/operation is a good thing - it automates a lot for you when, for example, working on a set of records that represent application settings, or even entries in a larger grid.

    However, there seems to be one shortcoming: The Server Responses and the way the Ext.Direct API deals with them

    In general, there are 5 cases the API has to properly respond to.

    Updating data server side:
    ====================
    1) Data with id [id] was successfully updated
    2) Data with id [id] was successfully updated, but data with id [id2] could not be updated
    3) An exception was thrown, the state of the update is unknown
    4) A timeout occured, the response was empty
    5) No data was successfully updated

    Cases 3, 4, 5 can be summed up and treated equally. However, case 1 and 2 need special treatment.

    Case 1:
    ======

    Let's say I'm updating the records with the ids 1 and 2. The request sends the data array to the server. The server is able to update both data successfully.

    The response should include the following data:

    Code:
    result: {
        success : true,
        updated : [1, 2],
        failed     : []
    }
    Case 2:
    ======

    Let's say I'm updating the records with the ids 1 and 2. The request sends the data array to the server. The server is able to update record with id 1 successfully, bit updating record with id 2 failed:

    The response should include the following data:

    Code:
    result: {
        success : true,
        updated : [1],
        failed     : [2]
    }
    The same applies for deleting records - sending back the ids where the action succeeded and simultaneously giving infomration about the ids where the action failed.

    The Ext.Direct API should then (as a standard behavior) process the updated/failed properties and commit/rollback actions taken on the records with the given ids.

  2. #2
    Sencha User thesilentman's Avatar
    Join Date
    Apr 2007
    Location
    Athens, Greece
    Posts
    232
    Vote Rating
    2
    thesilentman is on a distinguished road

      0  

    Default


    nice spotting.
    +1 for those propositions

  3. #3
    Sencha User ThorstenSuckow's Avatar
    Join Date
    Sep 2007
    Location
    Aachen, Germany
    Posts
    597
    Vote Rating
    2
    ThorstenSuckow is on a distinguished road

      0  

    Default


    Quote Originally Posted by thesilentman View Post
    nice spotting.
    +1 for those propositions
    I had this one implemented for Ext 2.1. I'm currently in the process of implementing this for Ext.Direct - I let you know once its finished.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi