This is a migrated thread and some comments may be shown as answers.

Refresh after update

1 Answer 192 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Mateusz
Top achievements
Rank 1
Mateusz asked on 19 Aug 2015, 09:08 AM

Hello 
I have question how to refresh control after edit?

I tried:

  • return all data after upadte but this doesn't work
public JsonResult Update([DataSourceRequest] DataSourceRequest request, ProductCategoryViewModel category)
       {
           if (ModelState.IsValid)
           {
               var services = new ProductCategoryServices(db);
               services.Update(category, ModelState);
           }
 
           var result = db.ProductCategories.ToTreeDataSourceResult(request,
                               cat => cat.ProductCategoryId
                               , cat => cat.FKParentProductCategoryId
                               , cat => cat.ToProductCategoryViewModel(request)
               );
 
           return Json(category, JsonRequestBehavior.AllowGet);
          // return Json(new[] { category }.ToTreeDataSourceResult(request, ModelState));
       }
  • - also add some events like:
    - requestEnd it is call only once
    - complete added to update action in trasport but this work also only once and only if inside is alert function
  • event onSave on TreeList also doesn't work

PS. Stupid question but where is edit post option? :)

1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 20 Aug 2015, 04:27 PM
Hello,

You may want to call refresh on the treelist object, to repaint the UI using the new dataitems. Example:

$("#treelist").data("kendoTreeList").refresh()

Regards,
Genady Sergeev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
TreeList
Asked by
Mateusz
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or