0

javascript cannot catch id of zul component. Please help.

asked 2018-12-28 14:11:20 +0800

cindy951357 gravatar image cindy951357
3 2

updated 2019-02-14 18:43:09 +0800

cor3000 gravatar image cor3000
4671 2 7
ZK Team

Hello. I am integrating jquery ui and zk.

The alert function only gives me "undefined", while I actually wrote the ID in the zul page.

my javascript:

$("."+draggableDivString).draggable({

    start: function(e,ui) {
         alert($(ui.draggable).attr('id'));
    },
    drag: function() {

    },
    stop: function() {

    },
    containment:"parent"
});

Could anyone tell me how to solve this?Thanks.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-02-14 19:15:08 +0800

cor3000 gravatar image cor3000
4671 2 7
ZK Team

You need to get the ID of the client side widget:

start: function(e, ui) {
    var zkWidget = zk.$(this);
    zk.log('dragged widget id: ' + zkWidget.id);
},

Here a runnable example: http://zkfiddle.org/sample/37qagib/1-jquery-ui-draggable-widget-id

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2018-12-28 14:11:20 +0800

Seen: 15 times

Last updated: Feb 14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More