PDA

View Full Version : [CLOSED] Gridpanel with direct method - searching



Kev
May 03, 2013, 12:24 PM
Hello,
I've got a grid panel binding / paging using a direct method. What I'd like to do now is search the grid panel using combo boxes outside of the grid panel - hence the need call the pageproxy's DirectFn="BindData" method again.

On select of a combo box, I've got a direct event called "GetGridpanelData" which calls the server side direct event. But what it needs to do then is somehow call the direct method which binds the data again. How do I do this? I presume I need to call a method on the store to fire this? Could you show a simple example? Here's my code

"Store1" proxy:



<Proxy>
<ext:PageProxy DirectFn="App.direct.BindData" />
</Proxy>


Server side method for binding data:



[DirectMethod]
public object BindData(string action, Dictionary<string, object> extraParams)
{
StoreRequestParameters pageParams = new StoreRequestParameters(extraParams);

TicketResponse ticketResponse = _managerFactory.TicketManager.GetOpenTickets(User. UserIdentity.AccountId, CreatePageRequest(pageParams));
List<Ticket> data = ticketResponse.Tickets;
int total = ticketResponse.TotalCount;

return new { data, total };
}


direct event fired from combo box:



[DirectMethod]
public void GetGridpanelData(object sender, DirectEventArgs e)
{
//Need to hit BindData method here now...how do I do this with my store called "store1"?
}

Kev
May 03, 2013, 1:11 PM
Found it:



[DirectMethod]
public void GetGridpanelData(object sender, DirectEventArgs e)
{
store1.LoadProxy();
}

Daniil
May 03, 2013, 2:08 PM
Hi @Kev,

Please note that there is no need to put a [DirectMethod] attribute for a DirectEvent handler.