PDA

View Full Version : [CLOSED] Store Loaded and access data in Store from cs use sqldatasource



siyahgul
Feb 10, 2015, 1:37 PM
<ext:Store runat="server" ID="storeBirimler" DataSourceID="sdsBirimler">
<Model>
<ext:Model runat="server" IDProperty="birimler_id">
<Fields>
<ext:ModelField Name="birimler_id" />
<ext:ModelField Name="iliski_id" />
<ext:ModelField Name="iliski_id_root" />
<ext:ModelField Name="birim_adi" />
</Fields>
</ext:Model>
</Model>
</ext:Store>

When the store is loaded by the code needed to access the data in the store. How can I do this?

Daniil
Feb 10, 2015, 3:02 PM
Hi @siyahgul,

You can submit submit a Store's/GridPanel's data to server. Here is a couple of examples.
http://examples2.ext.net/#/GridPanel/Miscellaneous/Submit_to_Handler
http://examples2.ext.net/#/GridPanel/Miscellaneous/Submit_Two_Grids

siyahgul
Feb 11, 2015, 9:33 AM
I don't want to use the grid panel.

Daniil
Feb 11, 2015, 9:46 AM
You can submit a Store's data.

siyahgul
Feb 11, 2015, 10:00 AM
Can I access data in store by cs ? ex: storeBirimler.GetRange(0);

Daniil
Feb 11, 2015, 10:15 AM
A short answer is no. For details, please read this thread.
http://forums.ext.net/showthread.php?10705

siyahgul
Feb 11, 2015, 10:25 AM
Value="GridPanel1.getRowsValues()"

this is examples use the grid panel. We disagree.

Daniil
Feb 11, 2015, 10:46 AM
For a Store you can use

store.getRecordsValues();

siyahgul
Feb 11, 2015, 11:02 AM
scenario

20961

siyahgul
Feb 11, 2015, 1:39 PM
//source side
<ext:Button ID="btnTest" runat="server">
<Listeners>
<Click Handler="
App.direct.btnTestClick(App.storeBirimler.getRecor dsValues(),
{
eventMask: {
showMask: true,
minDelay: 500,
msg: '??leminiz yap?l?yor'
}
});
" />
</Listeners>
</ext:Button>

//cs side
[DirectMethod]
public void btnTestClick(Dictionary<string, object>[] data)
{
foreach (Dictionary<string, object> item in data)
{
txtDragSonuc.Text += item["gnl_birimler_id"].ToString() + ",";
}
}



it's working thanks.

2. question:

store was loaded event ? (javascript side)

Daniil
Feb 11, 2015, 1:41 PM
There is the Load event you might want to use.

<ext:Store runat="server">
<Listeners>
<Load Handler="alert('Load');" />
</Listeners>
</ext:Store>

siyahgul
Feb 11, 2015, 2:00 PM
hey man. :) thank you.