Results 1 to 6 of 6

Thread: How to set scroll position to bottom for container

  1. #1
    Sencha User
    Join Date
    Jun 2016
    Posts
    5

    Default How to set scroll position to bottom for container

    Hi , i am stuck in an issue related to scroll bar position , i m creating a chat box.
    When i am adding text to the container it scroll position moves to top . i want to set
    The svcoll position to bottom every time. Please help me regarding this.

    Thanks in advance

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Are you using Ext JS or Touch? Which specific version? Can you include some of your code so we can get a better idea of what's happening here?

  3. #3
    Sencha User
    Join Date
    Jun 2016
    Posts
    5

    Default i m using ext 6.0

    Here is my container, dynamically i add the fields to this
    { xtype: 'container',
    reference:'container1',
    style: 'border-bottom:1px solid #e1e1e1;margin-bottom:5px;vertical-align:top;',
    height: 240,
    scrollable: true,
    layout: { type: 'table',
    columns: 2
    },
    items: [{ xtype: 'hiddenfield',
    name: 'Id',
    bind: {
    value: '{Id}'
    }
    } ] }

    --- Here is the fields which i added dynamically


    var container = view.lookupReference('container1'); container.add({
    xtype: 'label',
    text: 'You:'
    reference: 'label',
    style: 'padding:5px;color:#024D89;font-family:verdana;font-size:13px;line-height:30px;font-weight:bold;text-align:right;float:right;'
    }, { xtype: 'label',
    reference: 'text',
    text: message
    }

  4. #4
    Sencha User
    Join Date
    Jun 2016
    Posts
    5

    Default

    any solution for my query ??

  5. #5
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Can you utilize the scrollTo() method to scroll down to the bottom after adding a record?

  6. #6
    Sencha User
    Join Date
    Jun 2016
    Posts
    5

    Default How to set scroll position to bottom for container

    No, ScrollTop is not working. i handle the issue with javascript property


    document.getElementById(containerId).scrollTop = 999999;it helps to set the scroll position to bottom.Thank you for your help!

Similar Threads

  1. Replies: 2
    Last Post: 5 Aug 2015, 9:08 AM
  2. How do I reset a container's scroll position?
    By hermann.s in forum Ext: Q&A
    Replies: 6
    Last Post: 22 May 2014, 2:37 AM
  3. Container scroll bar listener, reach bottom
    By Csegota in forum Ext: Q&A
    Replies: 2
    Last Post: 14 Oct 2013, 2:12 AM
  4. Replies: 4
    Last Post: 27 Apr 2011, 4:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •