Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • ynaik
    replied
    Originally posted by katrays
    Did the HeaderClickEvent work? The event doesn't seem to invoke the handler code, in my case. My grid is not bound to a datasource. I am populating the values through setData() method, another approach for pagination grid. I am struck in Sorting behavior. Can someone help.
    Yes, HeaderClickEvent worked for me.


    listGrid.addHeaderClickHandler(new HeaderClickHandler() {

    public void onHeaderClick(HeaderClickEvent event) {

    listGrid.invalidateCache();
    listGrid.setSortField(event.getFieldNum());




    }
    });

    Leave a comment:


  • katrays
    replied
    Did the HeaderClickEvent work? The event doesn't seem to invoke the handler code, in my case. My grid is not bound to a datasource. I am populating the values through setData() method, another approach for pagination grid. I am struck in Sorting behavior. Can someone help.


    Originally posted by ynaik
    Thanks a lot mnenchev for your prompt reply ,

    Do I have invalidateCache on HeaderClickEvent

    listGrid.addHeaderClickHandler(new HeaderClickHandler() {

    public void onHeaderClick(HeaderClickEvent event) {

    listGrid.invalidateCache();
    listGrid.setSortField(event.getFieldNum());

    }
    });

    How can i set the Request.getSortBy() value in executeFetch Method ? Please Help

    Leave a comment:


  • ynaik
    replied
    Originally posted by mnenchev
    Dude, if u=you set cansort = false, how can you expect to sort something :)? In order to force server sorting only, always invalidate the cache.

    1) is it possible to disable the Client Side Sorting (Right click on Column Header, I don;t want see Sortng options)

    2) is it possible to add custom Filter builder option on right click of Column Header ? The default options are Sort Asc,Sort Desc ,Columns,Group By & Freeze Id.

    Leave a comment:


  • mnenchev
    replied
    Dude, if u=you set cansort = false, how can you expect to sort something :)? In order to force server sorting only, always invalidate the cache.

    Originally posted by ynaik
    I was able to obtain the Request.getSortBy() value after commenting the following line

    listGrid.setCanSort(false);

    If I comment it //listGrid.setCanSort(false); ,
    then I get the column value using Request.getSortBy() & both the client & server side sorting are enabled.

    When i uncomment it then Request.getSortBy() is always null & unable to do server side sorting.

    How can i disable client side sorting & retain just the server side sorting ?

    Thanks in advance.

    Leave a comment:


  • ynaik
    replied
    Originally posted by ynaik
    Thanks a ton, For some reason request.getSortBy(); is returning null always , dunno which property of ListGrid triggers this value ?

    Please let me know if i have to set some special property to get this value, I will check all DS declarations, Thanks again "mnenchev", you are a Great help.

    I was able to obtain the Request.getSortBy() value after commenting the following line

    listGrid.setCanSort(false);

    If I comment it //listGrid.setCanSort(false); ,
    then I get the column value using Request.getSortBy() & both the client & server side sorting are enabled.

    When i uncomment it then Request.getSortBy() is always null & unable to do server side sorting.

    How can i disable client side sorting & retain just the server side sorting ?

    Thanks in advance.

    Leave a comment:


  • ynaik
    replied
    Originally posted by mnenchev
    Code:
    //in ds :
    	final String sortBy = request.getSortBy();
             someRPCservice.fetch(sortBy,..........).....
    ................
    // in rpc impl fetch
    	if (sortBy != null) {
    			
    				if (sortBy.charAt(0) == '-') {
    			
    					descendingSortOrder = true;
    				} else {
    					descendingSortOrder = false;
    				}
    			}
    //        sql query using descendingSortOder
    If you use the code from this thread it must work, check your datasources declarations?!

    Thanks a ton, For some reason request.getSortBy(); is returning null always , dunno which property of ListGrid triggers this value ?

    Please let me know if i have to set some special property to get this value, I will check all DS declarations, Thanks again "mnenchev", you are a Great help.

    Leave a comment:


  • mnenchev
    replied
    Code:
    //in ds :
    	final String sortBy = request.getSortBy();
             someRPCservice.fetch(sortBy,..........).....
    ................
    // in rpc impl fetch
    	if (sortBy != null) {
    			
    				if (sortBy.charAt(0) == '-') {
    			
    					descendingSortOrder = true;
    				} else {
    					descendingSortOrder = false;
    				}
    			}
    //        sql query using descendingSortOder
    If you use the code from this thread it must work, check your datasources declarations?!

    Leave a comment:


  • ynaik
    replied
    Originally posted by mnenchev
    I think this is done automatically?!?!
    Yes , It is suppose to set this value automatically but it is not.

    1) Any idea how to set sortState on ListGrid ?

    listGrid.setSortState(?String ) , dunno how to set this input string value

    which property of listGrid sets the DSRequest.getSortBy() value?

    when i print the listGrid.getSortState(), i see the following values
    listGrid.getSortState() = ({
    fieldName:null,
    sortDir:false
    })

    2) any sample code on server side sorting using simple smartgwt ListGrid with GWT RPC mechanism?

    3) Can some one guide me on how to achieve server side sorting using GWT RPC ?

    Thanks in advance

    Leave a comment:


  • mnenchev
    replied
    There is no real paging grids, you must develop one. Btw i met somewhere example for smart gwt in some thread. Look for it.
    Originally posted by paatal
    Thanks mnenchev for your quick reply...
    yes you're right i want to create real paging grid,
    is there any other way to achieve this?
    i don't need life grid with grid scrolling .... i can't found any other grid ....




    ___________________
    Thanks,
    Paata Lominadze,
    Magticom LTD.

    Leave a comment:


  • mnenchev
    replied
    I think this is done automatically?!?!
    Originally posted by ynaik
    Thanks a lot mnenchev for your prompt reply ,

    Do I have invalidateCache on HeaderClickEvent

    listGrid.addHeaderClickHandler(new HeaderClickHandler() {

    public void onHeaderClick(HeaderClickEvent event) {

    listGrid.invalidateCache();
    listGrid.setSortField(event.getFieldNum());

    }
    });

    How can i set the Request.getSortBy() value in executeFetch Method ? Please Help

    Leave a comment:


  • ynaik
    replied
    Originally posted by mnenchev
    You have to implement the sorting logic on the server if you use rpc, SortBy returns the name of the column for asc or -column name for desc (i think?!?).
    Client sorting is done automatically, by default by sorting all cached records. This can be tricky if you want server sorting you may want to invalidate the cache.
    Thanks a lot mnenchev for your prompt reply ,

    Do I have invalidateCache on HeaderClickEvent

    listGrid.addHeaderClickHandler(new HeaderClickHandler() {

    public void onHeaderClick(HeaderClickEvent event) {

    listGrid.invalidateCache();
    listGrid.setSortField(event.getFieldNum());

    }
    });

    How can i set the Request.getSortBy() value in executeFetch Method ? Please Help

    Leave a comment:


  • paatal
    replied
    RE:

    Thanks mnenchev for your quick reply...
    yes you're right i want to create real paging grid,
    is there any other way to achieve this?
    i don't need life grid with grid scrolling .... i can't found any other grid ....

    Originally posted by mnenchev
    Well, even if you set 20 records smart gwt will fetch a little more, than 20. If you mean real paging you will not find one, because the paging is done by life grid with grid scrolling.

    ___________________
    Thanks,
    Paata Lominadze,
    Magticom LTD.

    Leave a comment:


  • mnenchev
    replied
    You have to implement the sorting logic on the server if you use rpc, SortBy returns the name of the column for asc or -column name for desc (i think?!?).
    Client sorting is done automatically, by default by sorting all cached records. This can be tricky if you want server sorting you may want to invalidate the cache.

    Originally posted by ynaik
    Hi,

    Can you please post sample line of code to invoke the server side sorting in ListGrid Using GWT RPC.

    How to enable the server side sorting on ListGrid?
    on executeFetch, request.getSortBy() always shows null, how to set this value?

    showcase example was not much of help, can somebody please post the client side sorting line of code vs server side sorting line of code

    Thanks for your great support.

    Leave a comment:


  • mnenchev
    replied
    Well, even if you set 20 records smart gwt will fetch a little more, than 20. If you mean real paging you will not find one, because the paging is done by life grid with grid scrolling.

    Originally posted by paatal
    sorry i missed my server implementation file.
    GwtRpcDataSource.java and FetchResult.java i took from this forum, if required i can post them.

    Leave a comment:


  • paatal
    replied
    missed file

    sorry i missed my server implementation file.
    GwtRpcDataSource.java and FetchResult.java i took from this forum, if required i can post them.
    Attached Files
    Last edited by paatal; 21 Jul 2009, 21:32.

    Leave a comment:

Working...
X