Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4831

parseStyle splits css string incorrectly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.6.0
    • 6.5.8.1, 9.5.1
    • ZK Client Engine
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      update the style of any componennt via ajax (initially works) setting e.g. a background image:

      mydiv.setStyle("width: 200px; height: 200px; background-image: url('https://example.com/image.png')");
      

      Current Result

      the resulting div only receives the url('https part of the image url

      <div id="hT5Q1" style="width: 200px; height: 200px; background-image: url(&quot;https&quot;);" class="z-div">
      

      Expected Result

      the full url in for the background image

      Debug Information

      The jq.parseStyle() method can be tested in isolation, causing the parsing error.

      The css is parsed into key value pairs splitting the string by ';' and ':'

      jq.parseStyle("background-image: url('https://example.com/image.png')")
      --> { "background-image": "url('https" }
      

      Workaround

      call invalidate() to re-render the whole div (like initial rendering)

            DevChu DevChu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Remaining Estimate - 1 day
                1d
                Logged:
                Time Spent - Not Specified
                Not Specified