jQWidgets Forums
Forum Replies Created
-
Author
-
Aha, see it now. Works brilliantly.
This would be useful when added.
October 15, 2012 at 9:02 pm in reply to: Different event signatures for dragEnd event Different event signatures for dragEnd event #9489Both seem useful:
dragEnd function: To determine whether a drag is allowable before the drag is completed, and even before asking the user to confirm
dragEnd event: To finalize and persist the operation after the user has confirmed and the drag/drop is confirmed completed, and for other components to appropriately reflect the change.How might one get the following info available as args to the first function, from the ‘event’ argument to the second?
* item -> event.args.originalEvent.element
* dropItem -> ?
* dropPosition (‘before’, ‘inside’, ‘after’) -> ?October 15, 2012 at 3:25 am in reply to: Attach data to jqxTree for later reference Attach data to jqxTree for later reference #9411see the data-id tag disappeared in edit. For the record,…
{ label: <div data-id='982349028' >Label 1</div>", items: [...] }, ...
October 15, 2012 at 2:55 am in reply to: Attach data to jqxTree for later reference Attach data to jqxTree for later reference #9406Not sure if this is the way a real programmer would do it, but this seems to work. Instead of putting in a simple string for the label, put an actual HTML element in the `source` object, e.g.
var source = [{ label: "<div>Label 1</div>", items: [...] }, ...]
Of course the label is autogenerated by code, rather than typed. Now on select, can extract that identifier as follows:
$(‘#jqxTree’).bind(‘select’, function (event) {
var htmlElement = event.args.element;
var myElement = $(“.elementLabel”, htmlElement);
var elementId = myElement.data(‘id’);
console.log(elementId);myApp.selectItemById(elementId);
});(sorry if someone is getting multiple emails, trying to find the right way to specify HTML code so that it gets escaped and displayed verbatim rather than interpreted by the forum app)
-
AuthorPosts