Results 1 to 5 of 5

Thread: How to do CRUD operation using Grid with JSON Rest ful service

  1. #1

    Default How to do CRUD operation using Grid with JSON Rest ful service

    Hi All,
    I am not sure what I am missing here.

    I have a rest ful json service. I am able to load data from it to show it in a Grid using following code

    // use a http proxy to get the data
    RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, GWT
    .getHostPageBaseURL()
    + "json/employee/get/all");
    HttpProxy<String> proxy = new HttpProxy<String>(builder);

    // need a loader, proxy, and reader
    JsonLoadResultReader<ListLoadResult<ModelData>> reader = new JsonLoadResultReader<ListLoadResult<ModelData>>(
    type);

    final BaseListLoader<ListLoadResult<ModelData>> loader = new BaseListLoader<ListLoadResult<ModelData>>(
    proxy, reader);

    ListStore<ModelData> store = new ListStore<ModelData>(loader);
    final EditorGrid<ModelData> grid = new EditorGrid<ModelData>(store, cm);


    I want to now update the json rest ful service using Grid. Say user adds a new row in grid, it should fire a post request with json snippet to the json rest ful service, similar thing for update and delete operations.

    How can I do that?

    In ExtJs I was that when you create a HTTPProxy you can specify different urls for CRUD Operations. How to go about doing that in EXT GWT?

    Cheers,
    Rohit

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    Nothing like this is directly integerated to GXT.

    You will need to listen to the Add event of the ListStore (for example) and start your request to the server manually.

  3. #3

    Default

    Fine, fair enough

    Now I want to know would GXT help me atleast in creating the json string from grid's row? Or will I have to create the json by hand


    Also, is there any reference or example of CRUD Editable Grid working with either json/xml restful service, so I can replicate my code from there.

  4. #4
    Sencha Premium User
    Join Date
    Apr 2010
    Posts
    1

    Default

    Hi,

    I'm wondering if in the Ext-GWT 3.0 stores there will be the same Rest CRUD fonctionality as in the ExtJS one?

    If not, why? and how to achieve this easyly?

    Cheers.

  5. #5

    Default Calling a RESTful service

    What is the standard way of calling a RESTful service from a listener in GXT?

Similar Threads

  1. Problems with REST crud
    By kesteb in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 12 Jan 2011, 3:23 PM
  2. gridPanel shows data from REST service in IE but not in Firefox
    By mirceat in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 26 Feb 2010, 3:02 AM
  3. Problems when requesting REST service
    By gaquino in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 10 Dec 2009, 12:21 PM
  4. combobox and parameterized rest service
    By sebmiz in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 9 Dec 2008, 8:21 AM
  5. Designing my REST web service for ExtJS
    By cappuccino in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 13 Oct 2008, 10:23 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •