1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    16
    Vote Rating
    0
    Steve973 is on a distinguished road

      0  

    Question What happens on grid column header click?

    What happens on grid column header click?


    Hi All,

    Could any of you either point me in the right direction or describe exactly what happens when a grid's column header is clicked? I'll give the specifics of my situation:

    I am using a Gird<BeanModel> that uses an RpcProxy<PagingLoadResult> to load the data into the Grid's store. I have a class that extends BaseListLoadConfig and implements PagingLoadConfig because I need to pass some parameters to my search service. Of course, this works great when my code initiates the search, since I can populate my custom object, but the problem (ClassCastException) occurs when I click a column header to perform a sort of the data. I assume that is because this event is creating an object of the type BasePagingLoadConfig (according to Firebug). If the results in this grid are the results of a user-specified search, including customized search parameters, I don't exactly know how the functionality of clicking a column header should work.

    Any ideas or suggestions are welcome, and thanks in advance.

    Steve

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    If you would post the stacktrace it would be much easier to may say what the problem is

  3. #3
    Sencha User
    Join Date
    Dec 2009
    Posts
    16
    Vote Rating
    0
    Steve973 is on a distinguished road

      0  

    Default


    Sven, done:

    00:00:37.187 [ERROR] Uncaught exception escaped
    <pre>java.lang.ClassCastException: com.extjs.gxt.ui.client.data.BasePagingLoadConfig cannot be cast to org.myapp.web.client.controller.FacetSearchPagingLoadConfig
    at org.myapp.web.client.entrypoint.MyApp$3.load(MyApp.java:206)
    at com.extjs.gxt.ui.client.data.RpcProxy.load(RpcProxy.java:21)
    at com.extjs.gxt.ui.client.data.BaseLoader.loadData(BaseLoader.java:134)
    at com.extjs.gxt.ui.client.data.BaseLoader.load(BaseLoader.java:98)
    at com.extjs.gxt.ui.client.data.BaseLoader.load(BaseLoader.java:92)
    at com.extjs.gxt.ui.client.store.ListStore.sort(ListStore.java:378)
    at com.extjs.gxt.ui.client.widget.grid.GridView.doSort(GridView.java:955)
    at com.extjs.gxt.ui.client.widget.grid.GridView.onHeaderClick(GridView.java:1522)
    at com.extjs.gxt.ui.client.widget.grid.GridView$8.onHeaderClick(GridView.java:1401)
    at com.extjs.gxt.ui.client.widget.grid.ColumnHeader$Head.onClick(ColumnHeader.java:289)
    at com.extjs.gxt.ui.client.widget.grid.ColumnHeader$Head.onComponentEvent(ColumnHeader.java:264)
    at com.extjs.gxt.ui.client.widget.Component.onBrowserEvent(Component.java:876)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1307)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1263)
    at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
    at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
    at java.lang.Thread.run(Thread.java:619)</pre>

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    The listloader creates a loadconfig, because it did not get one. two solutions.

    Extend BasePagingListLoader and override newLoadConfig to return your loadconfig or, fix your rpcproxy.load method, because the exception is in your code. You are casting without checking it.

  5. #5
    Sencha User
    Join Date
    Dec 2009
    Posts
    16
    Vote Rating
    0
    Steve973 is on a distinguished road

      0  

    Default


    It might be my design that is flawed, so I could definitely accept that. Is there another way (some kind of best-practice) to pass custom parameters to your search service if not in the LoadConfig object?

Similar Threads

  1. How to call a javascript function on column header click in ext js grid?
    By ketanmulay in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 21 Jan 2010, 9:36 PM
  2. Dbl click column header to autosize
    By wayne_o in forum Ext 2.x: User Extensions and Plugins
    Replies: 18
    Last Post: 14 Oct 2009, 10:45 PM
  3. click grid column header programmingly
    By angelflaree in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 3 Apr 2008, 7:40 AM
  4. Replies: 16
    Last Post: 21 Feb 2008, 11:49 PM
  5. give an alert when i click on column header
    By sreenija in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 23 Dec 2007, 8:16 PM

Thread Participants: 1