1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    107
    Vote Rating
    0
    sarabjeetd is on a distinguished road

      0  

    Default Unanswered: Use chart and slider in one panel

    Unanswered: Use chart and slider in one panel


    I have a chart and slider in a panel that work together. In order for the slider to be initialized, the chart has to be rendered because the slider uses the labels on the x-axis and these labels are not generated untill the chart is rendered (Correct me If I am wrong here and there is a way to build the labels without rendering the chart)

    In order to render the chart, I call panel.doLayout() on the container panel which contains the chart and the slider.

    What do I need to do so that it will redraw the panel which means it draws the chart and the slider.

    Calling panel.doLayout() again does not do anything.

    I am using ExtJS 4.1.0

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,154
    Vote Rating
    475
    Answers
    685
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Can you render the chart, and use the afterRender event to gather the labels, then create the slider?

    Regards,
    Scott.

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    107
    Vote Rating
    0
    sarabjeetd is on a distinguished road

      0  

    Default update

    update


    I am doing exactly as you stated. After I create the slider in the afterrenderer method, I don't see the slider in the panel. The only thing I see is the chart.

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,154
    Vote Rating
    475
    Answers
    685
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    What is your layout for rendering chart/slider? Do you have a place reserved for the slider?

    Scott.

  5. #5
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    107
    Vote Rating
    0
    sarabjeetd is on a distinguished road

      0  

    Default update

    update


    It is a container with a vertical box layout.

    Code:
    this._component = Ext.create('Ext.container.Container', {
            flex:(this._flex || 1),
            layout:(this._layout || {type:"vbox", align:"stretch"}),
            listeners: {
                afterrender: this._panelAfterRender,
                afterLayout: this._panelAfterLayout,
                resize: this.panelResize
            }
        });
    // Here is the code to add the slider to the container.
    chartContainerHandle.add(chartSlider);
    chartSlider.setPosition(chartSlider.x - 10, chartSlider.y);
    chartSlider.setHeight(26);

Thread Participants: 1