Results 1 to 5 of 5

Thread: Change value of Sparklineline via renderer

  1. #1
    Sencha User
    Join Date
    Apr 2014
    Posts
    110
    Answers
    10

    Default Answered: Change value of Sparklineline via renderer

    Hey,

    I hava a widgetColumn with a sparklineline.

    Code:
             xtype: 'widgetcolumn',         dataIndex:myIndex,
             widget:{
                xtype: 'sparklineline',
                fillColor: '#ddf',
                width: '100%',
                height: 20,
             },
    my Problem is I get as Data "189,0,0" instead of [189,0,0], so it is an string and not an array.
    I can't change it in my Store or Model because i first have the store and don't know which column is used...

    So I tired to change it by using the renderer Function, but nothing is working.
    Did someone knows what to do and where to do it?

    I tried e.g.:
    Code:
    renderer(value){
    this.setValues(value.split(","));
    }
    Thanks!

  2. var oNewColumn = {
    xtype: 'widgetcolumn',
    dataIndex:myIndex,
    widget:{
    xtype: 'sparklineline',
    fillColor: '#ddf',
    width: '100%',
    height: 20
    },
    renderer:function(value, oCol, oRecord){
    if(oRecord.data[myIndex] && typeof oRecord.data[myIndex] === 'string'){
    oRecord.data[myIndex] = oRecord.data[myIndex].split(",");
    }
    return value;
    }

    This is working fine!

  3. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165

    Default

    You should be able to set the values as you're attempting, but not within the renderer function. You may want to try this is a render or show listener, depending on when you feel the data needs changed. In the listener, get reference to your sparkline instance and call setValues().
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  4. #3
    Sencha User
    Join Date
    Apr 2014
    Posts
    110
    Answers
    10

    Default

    var oNewColumn = {
    xtype: 'widgetcolumn',
    dataIndex:myIndex,
    widget:{
    xtype: 'sparklineline',
    fillColor: '#ddf',
    width: '100%',
    height: 20
    },
    renderer:function(value, oCol, oRecord){
    if(oRecord.data[myIndex] && typeof oRecord.data[myIndex] === 'string'){
    oRecord.data[myIndex] = oRecord.data[myIndex].split(",");
    }
    return value;
    }

    This is working fine!

  5. #4
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165

    Default

    Glad you got it resolved.
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  6. #5
    Sencha User
    Join Date
    Apr 2014
    Posts
    110
    Answers
    10

    Default

    Thanks for your help!

Similar Threads

  1. Change renderer of a textfield
    By GVTREVA in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 4 Apr 2011, 1:09 AM
  2. Change Renderer during Runtime
    By ExtJSBeginner in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 3 Aug 2009, 7:12 AM
  3. renderer scope change?
    By Foggy in forum Ext 3.x: Help & Discussion
    Replies: 7
    Last Post: 9 Jun 2009, 6:53 AM
  4. I need change color . renderer:
    By maraf1 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 21 Dec 2007, 3:41 AM
  5. how to change the combobox list renderer(not item renderer)
    By fawzyj in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 14 Oct 2007, 10:16 PM

Tags for this Thread

Posting Permissions

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