Topic: In db_pager can we freeze first few columns

Hello, is it possible in FA to get first few columns freezed in db_pager_view?

www.boxygen.pk

Re: In db_pager can we freeze first few columns

I have successfully implemented this jquery solution for column and header freeze.

But I am stuck that once a page is reloaded due to Ajax Call then the following Jquery Function at the bottom of the page is not called.

<script>
$(document).ready(function() {

  $(".table-scrollable").freezeTable({
    'scrollable': true,
        'columnNum' : 5,

  });

});
</script>
www.boxygen.pk

Re: In db_pager can we freeze first few columns

Hello friends, need support on this

www.boxygen.pk

4 (edited by poncho1234 07/16/2019 02:19:58 pm)

Re: In db_pager can we freeze first few columns

Now I understand what you are looking for - if you are not totally committed to using js then:-

css only answer here on stackoverflow and here using position: sticky;
Can I use lists all major browsers except as usual IE.

You may have to add auto scroll or similar to the table as well

Lots of answers on SO and other sites with googling "freeze table header and columns css site:stackoverflow.com"

For 1st five of anything use something like :nth-child(-n+5)

No js = no js conflicts

There are also a few minimal js solutions too using the same search as above

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: In db_pager can we freeze first few columns

Thanks @poncho1234 you have suggested a non javascript solution.

But still my question is that how to get the Jquery Function workable after Ajax Call. My problem is discussed here. I have tried them but could not find workable in FA.

www.boxygen.pk

Re: In db_pager can we freeze first few columns

My js is yuk!...but my understanding of that SO post is $(document).ready() is already called somewhere else so you need something else to initialize it????????????????????????????????????????

The 'top' answer seems like  the one you want, it's in the comments...read 1 - 3 for that solution they had to replace the $(document).ready() to $(document).on... or something else in the third comment.

Hope that hasn't confused you more and you get it working

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: In db_pager can we freeze first few columns

hi,

You can use like this

$js = "alert('Hi')";

if (in_ajax()) {
    $Ajax->addScript(true, $js);
} else
    add_js_source($js);

this code will retain after ajax also

if you are using any jquery plugin and your jquery is loaded in footer part of renderer

then you have to load the plugin in renderer after jquery (it will be loaded on all pages)

or you can customize the core and define a function to load javascript files in footer

add_js_ufile() function is there but it will load in header only

ANOOP
Experience is the name everyone gives to their mistakes!

Re: In db_pager can we freeze first few columns

Hi @anoopmb your suggestion worked like a charm. I prefer to customize the core aand load JS in the footer.

Thanks Alot you have saved a lot of hassle for me.

I would request @joe to add such features in the upcoming 2.5

www.boxygen.pk