0

I'm using 1.7.2 When I add an item to objectstore I write

dataStore.newItem(data);

Then I tried saving dataStore.save() and then dijit.byId(gridId)._refresh() But browser hangs up.

I also tried re-assigning same store again to grid after adding item. Still no success

Ravi Khakhkhar
  • 1,924
  • 1
  • 18
  • 25

2 Answers2

1

Try calling

        dijit.byId(gridId).resize()
ejb_guy
  • 1,125
  • 6
  • 6
  • @RaviKhakhkhar You are trying to add data to Grid. After addition its not viewable or your browser is freezing – ejb_guy May 28 '12 at 08:35
  • Honestly, When I was trying day before yesterday, browser was freezing due to store.save(), but now using store.save() not causing that(I don't know reason). At the moment newly added item is not visible. – Ravi Khakhkhar May 28 '12 at 10:58
  • have you set the overflow style to auto? – ejb_guy May 28 '12 at 11:34
  • sorry. It's done. It was my big fault. Forgot to set handleAs:json and because of that it was not coming in grid. Your soluction is working. upvoted :) – Ravi Khakhkhar May 28 '12 at 11:51
1

Use the grid's setQuery method.

dijit.byId(gridId).setQuery(query);
Richard Ayotte
  • 5,021
  • 1
  • 36
  • 34
  • sorry Richard. Your point was right. By doing this we can actually refresh grid. At that point I was not using query and so was not convinced by your idea. – Ravi Khakhkhar Jul 16 '12 at 11:37