Inconsistent drag message in grid with masterdetail

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Normal
    • 8.6.1
    • Affects Version/s: 8.6.0.1
    • Component/s: None
    • Security Level: Jimmy
    • None
    • None

      Steps to Reproduce

      http://zkfiddle.org/sample/qdkvrc/1-inconsistent-drag-message-with-master-detail

      run fiddle
      drag 1st row
      open detail component (arrow on the left) and drag 1st row again

      Current Result

      when the detail is closed, the detail text appear first in the drag message
      when the detail is open, the detail text appear last in the drag message

      Expected Result

      The row message should stay consistent regardless of details open status

      Debug Info

      Root Cause

      the detail component position in the row child element list is firstChild when closed and lastChild when opened.
      Since the getDragMessage() fonction uses htmlNode.innerText to generate the message, it will display the content of the detail if the detail is 1st (closed) and will not if the detail is last (opened)

      Workaround

      <script><![CDATA[
      zk.afterLoad('zul.grid', function() {
      	var xRow = {};
      	zk.override(zul.grid.Row.prototype, xRow ,{
      		getDragMessage_: function () {
      		if (jq.nodeName(this.getDragNode(), 'tr', 'td', 'th')) {
      			var n = this.$n('real') || this.getCaveNode(),
      				msg = n ? n.innerText || n.textContent || '' : '';
      			return msg ? zUtl.encodeXML(msg) : msg;
      		}
      	}
      	});//zk.override
      });//zk.afterLoad
       ]]></script>
      

            Assignee:
            Leon03
            Reporter:
            MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 2 days
                2d
                Remaining:
                Time Spent - 1 day, 2 hours Remaining Estimate - 6 hours
                6h
                Logged:
                Time Spent - 1 day, 2 hours Remaining Estimate - 6 hours
                1d 2h