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

parseStyle splits css string incorrectly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.5.8.1, 9.5.1
    • Fix Version/s: 9.6.0
    • Component/s: ZK Client Engine
    • Security Level: Jimmy
    • Labels:

      Description

      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)

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

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