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

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

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. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 8 years, 7 months ago Alex S
    Hi, I Work Here

    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. 8 years, 7 months ago devworks

    Thank you! That is the way I did :)

  3. 8 years, 7 months ago Alex S
    Hi, I Work Here

    Hi Devworks,

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

  4. 8 years, 7 months ago devworks

    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.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More