View Full Version : JsonReader Problem

Oct 17, 2008, 7:57 AM
Can I use JsonReader this way?

Resulted string 's' = { rowCount:48, list:[ {markID:3}, {markID:4}, ....] };

But no data is bound. If I remove root="list" property, than bound many empty rows.

What is wrong with this code.

<script runat="server">

protected void Store1_RefreshData(object sender, StoreRefreshDataEventArgs e)


ObStorage obStorage = new ObStorage();

ObRequest select = ObRequest.Select("autocatalog", "<searchable>");

ObRecordset rows = obStorage.Execute(select);

JsonObject root = new JsonObject();

root.Put("rowCount", rows.Count);

JsonArray list = new JsonArray(rows);

root.Put("list", list);

string s = JSON.Serialize(root);

Store1.DataSource = s;



protected void Page_Load(object sender, EventArgs e)


Store1_RefreshData(null, null);





<form id="form1" runat="server">

<ext:ScriptManager ID="ScriptManager1" runat="server" />

<ext:Store ID="Store1" runat="server"



<ext:JsonReader ReaderID="markID" TotalProperty="rowCount" Root="list">


<ext:RecordField Name="markID" Type="Int"/>





<ext:GridPanel runat="server" ID="GridPanel1" Title="Employees" Frame="true" StoreID="Store1" Height="300">

<ColumnModel runat="server">


<ext:Column DataIndex="markID" Header="Title" Width="150" />




<ext:RowSelectionModel runat="server" />



<ext:PagingToolBar ID="PagingToolBar1" runat="server" PageSize="3" StoreID="Store1"

DisplayInfo="true" DisplayMsg="Displaying employees {0} - {1} of {2}" EmptyMsg="No employees to display" />


<LoadMask ShowMask="true" />