Author Topic: Not able to remove css for <td> in pQ grid  (Read 3710 times)

Ajay

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 31
    • View Profile
Not able to remove css for <td> in pQ grid
« on: April 15, 2015, 06:50:23 pm »
Hi All,
I am uisng paramQuery grid for results.
If you scroll the horizontal scroll bar in the grid output, you will see that there are 4 or 5 empty columns on the right hand side of the grid.
In the scroll bar event, I am trying to find the css and remove that particular css.
Code:
 $('#gridDictationStatus .pq-grid-table').find('tr').not('.pq-row-hidden').find('td').each(function () {

                            if($(this).attr('style')!=undefined)
                            {
                                $(this).removeClass('pq-grid-cell');
                            }

                        });

But with this code, when i debug it is removing class for that particular <td>.
 when i see the Html,i am able to see the css for that particulat <td>.
 I want to know what I am doing wrong ?
Can we remove class for <td> thru jquery code?Is it possible?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6265
    • View Profile
Re: Not able to remove css for <td> in pQ grid
« Reply #1 on: April 16, 2015, 09:27:10 am »
Those empty columns are invisible ( and don't have borders ) by default, I don't see how removing pq-grid-cell class from them is going to help. A jsfiddle demonstrating your issue could be better to see what's going on.

Anyway, any DOM manipulations in pqGrid need to be done in refresh event.

http://paramquery.com/api#event-refresh

Hope it helps.

Ajay

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Not able to remove css for <td> in pQ grid
« Reply #2 on: April 16, 2015, 06:53:23 pm »
Hi,
Thanks.
it helped me i have done in the refresh event and it worked.
         searchDictationStatusGrid.on("pqgridrefresh", function (event, ui) {
               
                $('#gridDictationStatus .pq-grid-table').find('tr').not('.pq-row-hidden').find('td').each(function () {
                   
                    if($(this).attr('style')!=undefined)
                    {

                        $(this).removeClass("pq-grid-cell");
                    }

                });
            });