replaceAll in RowExpander

  1. #1

    replaceAll in RowExpander

    Hi,

    i want to manipulate the value in the RowExpander.

    The value is in Column "_ROWEXPANDER"

    For Example:

    
                        If boolShowRowExpander = True Then
    
                            Dim nPlugin As New RowExpander
                            nPlugin.Template.Html = "<span class=""darkgray""><br/>{_ROWEXPANDER}<br/><br/></span>"
    
                            Dim _Renderer As New Renderer("return record.get('_ROWEXPANDER').replaceAll('#{#','<').replaceAll('#}#','>')")
                            nPlugin.Renderer = _Renderer
    
                            .Plugins.Add(nPlugin)
    
                        End If
    any idea?

    Thanks Gidi
  2. #2
    Hello Gidi!

    I'm not sure what your goal is; you want to just set the contents of the expanded row into a value you store in one of the grid columns?

    Maybe one of these examples do what you need -- or give you clues on the behavior you want to attain?

    - Examples Explorer - RowExpander samples

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hi FabrÃ*cio,

    sorry it's only a snipped of my Code. If the store include the column(name) "_ROWEXPANDER" then he set the variable "boolShowRowExpander" on true und the gridpanel include the plugin Rowexpander. On SQL I want to inject HTML- Code for Example:

    #{#span#}#TEST#{#/span#}#.

    This Code i want to render in <span>TEST</span>. I hope you understand my what i want.

    Thanks for you reply.

    Gidi
  4. #4
    Okay, so you can place the text in the expanded row once you expand it; and then you can't replace the placeholders from the "escaped" string you receive from SQL?

    I would need more to help you with this issue, can't you wrap up a simplified test case showing your scenario? The SQL data can be just a few static object like we do in our examples. We have several use cases explored in the examples I linked above, if none of them are helping, I believe we should go on with a test case.

    For your code snippet, I believe that instead of a client-side renderer, you could just return the string from the _ROWEXPANDER data field already replaced, so you could just lay it using the template's HTML.

    I am not really certain you are in the right path using RowExpander.Renderer here; it may sound the logic thing to do, but behind the gears maybe there's a better way for you to attain that using the template. For instance, within templates you can use the {[ .. ]} syntax to execut inline code (the replaceAll() bit to be exact). See more about syntax in templates at Sencha Ext JS Documentation - XTemplate.

    Hope this helps! If these tips didn't help, let's try to talk in terms of a test case, and we'll be able to give you at least some alternatives to attain your objective!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Hi FabrÃ*cio,

    thanks, i also try this example

    nPlugin.Template.Html = "<div class=""tf-css-darkgray""><br/>{[values._ROWEXPANDER.toUpperCase()]}<br/><br/></div>"
    and it works.

    But i need for example this...

    nPlugin.Template.Html = "<div class=""tf-css-darkgray""><br/>{[values._ROWEXPANDER.replaceAll('t','test')]}<br/><br/></div>"
    but this does'n work.

    Thanks for your help
    Gidi
  6. #6
    Hello again, @Gidi!

    It really looks like a quoting/escaping issue, take a look at the generated code from your developer tools and check if the quotes are properly escaping; if not you may try to use \" or replace the strings with actual variables you set somewhere else. It looks like you may be close to what you need, so just take a closer look in the error message it shows on client side and pinpoint it using browser's developer tools.

    This is the last time will I mention about the test case, I promise! Provide us with one, then we can give you precise steps on how to handle the issue. :)
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. need help with gridview (rowExpander)
    By vitaly2020 in forum 5.x Help
    Replies: 1
    Last Post: Mar 13, 2020, 8:02 PM
  2. Replies: 4
    Last Post: Jan 18, 2015, 5:51 PM
  3. GridPanel RowExpander
    By idelacruz in forum 2.x Help
    Replies: 3
    Last Post: Mar 03, 2013, 5:29 PM
  4. RowExpander RowEditor
    By sharif in forum Examples and Extras
    Replies: 4
    Last Post: Nov 20, 2012, 7:47 AM
  5. RowExpander
    By mmiocev in forum 1.x Help
    Replies: 0
    Last Post: Apr 06, 2009, 12:56 PM

Posting Permissions