[CLOSED] Get text from paging

  1. #1

    [CLOSED] Get text from paging

    Hi,

    Currently in my paging toolbar, between first prev and next last, it shown Page 1 (textbox) of 1.
    I would like to get the "textbox" text only. Is that possible? How to do that?

    Thanks
    Last edited by fabricio.murta; Jan 04, 2017 at 6:27 PM.
  2. #2
    Hello @opendat2000!

    I believe all you have to do is set the AfterPageText and BeforePageText of the paging toolbar be empty when defining it!

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello...

    I think that i wasn´t so clear about my problem, so i try to explain myself, i need to control the events of the paginator to give it another behavior, but i only have found how change text and i need to control "before", "after", "first page" and "last page" events (purple circle in the image) and i need to get the value that the user entered on the textbox (red circle in the image)


    Click image for larger version. 

Name:	Sin título.jpg 
Views:	41 
Size:	40.3 KB 
ID:	24793
  4. #4
    Hello @Opendat2000!

    Okay, but probably if you want a custom behavior for all buttons and also the counter textfield inside, it would pretty much mean making an ordinary toolbar with 4 (or 5 with the refresh) buttons and a text field. And probably lighter than using the paging toolbar as it won't be skipping its programmed normal behavior. Or would you want it to both jump pages and do something else to your page?

    It seems you pointed this example: DataView Example with Paging

    So what you would need on this is basically a custom behavior for the first/last/next/previous buttons, and also a custom behavior for the text field (which currently shows the page number). And will you need them (the prev/next buttons for example) to still move page back and forwards?

    These components can be accessed via the children elements and custom behavior can be added via the on() method. But maybe I am still missing pieces of your requirements here.
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Hello Fabricio.murta Thanks for your quick response. I'll try to be more clear about what i am doing...

    I have a lot of registries, like 60 millions ... so i need to get partial data from my query and put it in the paginator, so when the user click on some arrow do the same query and get the corresponding rows, for that i need to know the value of the textfield with the current page, and tell to the arrow what rows get.
  6. #6
    Hello @opendat2000!

    Isn't this you are telling me remote paging? Or do you want to load some pages up front and handle the paging manually? This kind of hybrid paging is not supported, and would be quite a challenge to make it from scratch, I believe.

    But well, the text in the pager text field shows the current page, so all you have to do is grab the page data's current page.

    For instance, if I open this example: https://examples4.ext.net/Examples/G.../DirectMethod/

    I can get the paging toolbar via: var pt = Ext.getCmp('pagingtoolbar-1023')
    Then I can get the current page with pt.getPageData().currentPage.

    So then, want to bind a custom event for the 'previous' button there?

    1. Get the button from the paging toolbar. It is the second button, so: var prevBtn = pt.items.items[1]
    2. Bind it a custom action/code on click: prevBtn.on('click', function(item, e) { console.log('click!'); })

    This is client-side code. I hope these directions help you get started with your desired approach. The event binding above aggregates another event to the button, not overriding the default behavior of moving to the previous page.

    Better than this, probably will be only possible studying the component's source code (refer to the documentation for toolbar linked above) and making an extension for it. It may sound cumbersome but the challenge will be in the "business logic" behind what you want to do, not really just extending the button, which works in a very similar way of using base classes on an user class in OOP.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  7. #7
    Hello @opendat2000!

    Been some time since we replied this and still no feedback from you. Did the directions above help you at all? Still in need of assistance?..

    We may mark the thread as closed in at least 7 business days from now but you'll be able to reopen it by posting a follow up anytime you feel like!
    Fabrício Murta
    Developer & Support Expert
  8. #8
    Hello Fabricio.murta thank you for your help, we solved the issue, you can close the thread.
  9. #9
    Thanks for your feedback, closing!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] gridpanel with local paging. Maintain checkbox selection while paging
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 20, 2013, 10:20 AM
  2. [CLOSED] paging toolbar loses filter params when paging
    By ecko in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Mar 08, 2013, 10:15 AM
  3. Replies: 16
    Last Post: Nov 12, 2012, 1:11 PM
  4. Replies: 11
    Last Post: Jun 13, 2012, 4:53 PM
  5. [CLOSED] remove "Page" text in paging toolbar
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 22, 2011, 6:07 AM

Posting Permissions