Announcement

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

    how to update database, when a row a deleted in the smartGwt ListGrid

    Hello Friends...

    Now i need your help..
    I am working on SmartGwt Expendable Grid...I am using ListGrid Class
    to generate grid.
    i want to delete the row from the grid...and changes should reflect
    into my database..Please provide me some idea to do that...

    This is my code fragment...

    ....................................................................................................
    ListGrid listGrid = new ListGrid() ;

    listGrid.setShowRollOverCanvas(true);
    listGrid.setWidth(800);
    listGrid.setHeight(400);

    listGrid.setAnimateRollOver(true);
    listGrid.setCanExpandRecords(true);
    listGrid.setAlternateRecordStyles(true);
    listGrid.setShowAllRecords(true);
    listGrid.setSelectionType(SelectionStyle.SIMPLE);

    listGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);

    listGrid.setExpansionMode(ExpansionMode.DETAIL_FIELD);
    listGrid.setDetailField("report");

    // on click the remove button i want to delete the selected row from
    the database...
    // using this method "removeSelectedData();" my selected record
    deleted from the grid but not from the database.

    removeButton.addClickHandler(new ClickHandler() {

    public void onClick(ClickEvent event)
    {
    SC.say("Inside Remove Button");
    listGrid.removeSelectedData();
    }
    });

    NOTE:- I am directly fetching data from the database and set that
    data into the DataSource. and this datasource is linked with the grid.

    ......................................................................................................................................

    Now Please tell me how can i update my database when i delete selected
    record from the SmartGwt List Grid .


    I need Help...
    Thanks

    #2
    Hi,

    I want to know exactly the same thing plus Updating and Fetching and Adding. I tried to override updateData(...) but it is never called. What do I have to do??? In the documentation is written: "You configure DataSources, via property and method overrides, to send appropriate HTTP requests to your server, and to parse HTTP responses from your server, in order to fulfill the 4 core operations of the DataSource Protocol."
    What properties and what methods are meant?

    Cheers,
    Markus

    Comment


      #3
      Are you using DataSource class for this?
      You can use the OperationBindings which has all the operations fetch,update,remove etc.

      You just need to set URL to call the function which will access the databse and will updated that.

      you can set url like http://localhost:8080/XYZ?operation=removeDataFromDB

      Comment

      Working...
      X