Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not really sure I totally understand your problem, but, what I think you are trying to say is that when you drag a portlet, it's supposed to be binding a click event listener to the 'setup' (wrench) button on your portlet so that when it's clicked a dialog pops up. And, you are saying that when you click on that wrench, a dialog pops up for <em>all</em> your portlets and not just the one you clicked the button inside of.</p> <p>If that's the case, it may be that you are binding that wrench multiple times so that when its clicked, it will act as if its clicked more than once. The only recommendation I have for you is that instead of using the 'click' method use the 'bind' method. </p> <p>This is what I mean... Don't do this:</p> <pre><code>$("#maincontent .column .portlet-header .ui-icon-wrench").click(function() { // do stuff here }); </code></pre> <p>Do this instead and see if it makes any difference:</p> <pre><code>$("#maincontent .column .portlet-header .ui-icon-wrench").unbind('click').bind('click',function() { // do stuff here }); </code></pre> <p>If that doesn't help, let me know and I will see if I can help you further.</p> <p><strong>UPDATE:</strong> Okay, so I think I might understand your problem now... When that wrench gets clicked, it brings up a dialog and in that dialog you are allowed to make changes to a certain portlet. But, you don't know how to let the dialog box know what portlet it should be affecting on update.</p> <p>So, on that note, you can do something like this:</p> <pre><code> $("#maincontent .column .portlet-header .ui-icon-wrench").unbind('click').bind('click',function() { var portlet_to_edit = $(this).parents('.portlet').attr('id'); $("#dialog").css("visibility","visible"); $('#dialog').data('my_app.portlet_to_edit',portlet_to_edit); $("#dialog").dialog({ // some of your stuff here... buttons: { 'Update Chart': function() { var portlet_to_edit_id = $(this).data('my_app.portlet_to_edit'); var portlet_to_edit = $('#'+portlet_to_edit_id); // Do stuff with 'portlet_to_edit', for instance: portlet_to_edit.find('.portlet-content').remove(); // ... or whatever you wanted to do... }, // the rest of your buttons and stuff } }); $('#dialog').dialog('open'); }); </code></pre> <p>to your </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload