This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

How to get current row and/or cell id of my custom widget?

9 years ago · Last reply by devworks 9 years ago

Hello,

I an a newbie on your widget development and while going through your great guides everything works fine, I need to get (for JS variable) the cell id where my widget exists.

The output html starts with something like this:

<div class="panel-grid" id="pg-5-0">
        <div class="panel-grid-cell" id="pgc-5-0-0">
            <div class="so-panel widget widget_dw-slick-slider-widget panel-first-child panel-last-child" id="panel-5-0-0-0">

and I need to know the “pgc-5-0-0” value in order to select it via jQuery selector.

How I can do this?

Thank you in advance,
Akis

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

4
  1. Alex S Staff 9 years, 11 months ago

    Hi Devworks,

    Select the intended widget (via a click() or some other event), and then select get the id of the row via parent. As an example (please ignore the lack of an event),

    $('.so-widget-sow-hero-default-1e6da3885c0f').parent().attr('id');
  2. devworks 9 years, 11 months ago

    Thank you! That is the way I did :)

  3. Alex S Staff 9 years, 11 months ago

    Hi Devworks,

    Great to hear. Is there anything else I can help you with today?

  4. devworks 9 years, 11 months ago

    Thank you for your help and kindness. I am fine.

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread