Announcement

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

    RESTDataSource.removeData() does not remove the selected rows from ListGrid.

    I am using SmartClient8.0.
    When I remove the records selected in a ListGrid, the records are actually deleted from database, but the rows are still in the ListGrid. What can I do to remove the records as well as from ListGrid.

    The code I'm using:

    Code:
    isc.RestDataSource.create({
    	ID: "application",
    	fields: [
    		{name:"id", hidden:true, primaryKey:true},
    		{name:"name", title:"NAME"},
    		],
    		dataFormat: "json",
    		removeDataURL:"application_delete.htm"
    	});
    
    isc.Button.create({
    			ID: "removeButton",
    			title: "delete",
    			click: function()
    			{
    				application.removeData(appList.getSelection());
    			}
    		});
    
    isc.ListGrid.create({
    		ID:"appList",
    		dataSource: application,
    		width:"100%",
    		canEdit:false,
    		autoFetchData: true
    	});

    #2
    What do you return in application_delete.htm?

    It should be something like that:
    Code:
    {"response":{"status":0,"data":{"id":"value_of_primary_key_for_deleted_record"}}}
    With header Content-Type: application/json; charset=UTF-8

    Comment


      #3
      In case you are searching for the answer to this problem, got this far, and the problem isn't yet answered, also check that you have only one field with "primaryKey: true" set. If you do have a composite key, you might be able to return both values in the response from the server (I haven't checked this).

      Comment

      Working...
      X