Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 05:44
    ddnexus closed #265
  • 05:44
    ddnexus commented #265
  • 05:31

    ddnexus on acceptance-tests

    prepared infrastructure (compare)

  • 04:39

    ddnexus on removed-deprecated-locales

    removed deprecated locales (compare)

  • 04:38

    ddnexus on dev

    @pagy_locale explicitly initial… added link tags helpers to supp… version 3.9.0 and 1 more (compare)

  • 04:38

    ddnexus on 3.9.0

    (compare)

  • 04:38

    ddnexus on master

    @pagy_locale explicitly initial… added link tags helpers to supp… version 3.9.0 and 1 more (compare)

  • 02:08
    ddnexus commented #265
  • Oct 20 13:40
    ddnexus commented #265
  • Oct 20 12:47
    Tioneb12 opened #265
  • Oct 16 06:41
    ddnexus commented #220
  • Oct 16 02:17
    ddnexus commented #102
  • Oct 16 02:17
    ddnexus commented #102
  • Oct 16 02:15
    ddnexus closed #264
  • Oct 16 02:15
    ddnexus commented #264
  • Oct 16 02:15
    ddnexus commented #102
  • Oct 15 17:44
    weiserma edited #264
  • Oct 15 17:43
    weiserma opened #264
  • Oct 15 17:30
    weiserma commented #102
  • Oct 15 17:27
    weiserma commented #102
Domizio Demichelis
@ddnexus
pagy.js.erb
Ben
@yosupgurl
i get this now pagy.js.erb:8 Uncaught TypeError: Cannot read property 'getElementsByClassName' of null
Domizio Demichelis
@ddnexus
paste the content of pagy.js.erb please
Ben
@yosupgurl
<%= Pagy.root.join('javascripts', 'pagy.js').read %> window.addEventListener("load", Pagy.init) export { Pagy } global.Pagy = Pagy
sorry for all the questions, new to this kind of stuff.
Domizio Demichelis
@ddnexus
the new error is good
looking into it
Domizio Demichelis
@ddnexus
can you paste the contet of the js template?
Ben
@yosupgurl
i think you mean the JS with the Pagy.init, right? if so, it's this.
$(document).ready(function() {
    var mouseY = 0;
    var popupCounter = 0;

    $(document).mouseleave(function () {
        if (mouseY < 100 && localStorage.getItem('popupModal') != 'shown') {
          $('#popupModal').modal('show');
        }
          localStorage.setItem('popupModal', 'shown');
    });

    Pagy.init(document.getElementById('records_table'));
  });
Domizio Demichelis
@ddnexus
first it should not be tht... it should be Pagy.init(document.getElementById('container'));
and that is not the document that I Mean
the one where you have the j render...
Ben
@yosupgurl
oh, this is it. i just removed the render so that i could troubleshoot.
usually it looks like this. $('#records_table').append("<%=j :partial => 'partials/gallery_items' %>"); $('#div_next_link').html("<%=j render :partial => 'partials/next_link' %>"); Pagy.init(document.getElementById('records_table'));
Domizio Demichelis
@ddnexus
yes... that
so put it back like it was
and then change 'records_table' to 'container'
and the pagy.init should not be in a $(document).ready function
either I don't understand what you said, or you have quite a lot of mess in your app :)
Ben
@yosupgurl
sorry, i am pretty confused at this point haha. But i did everything like you said. I put the Pagy.init outside of the document.ready.
issue persists pagy.js.erb:8 Uncaught TypeError: Cannot read property 'getElementsByClassName' of null
changed records_table to container.
Domizio Demichelis
@ddnexus
paste the content please
Ben
@yosupgurl
Pagy.init(document.getElementById('container'));
$(document).ready(function() {
    var mouseY = 0;
    var popupCounter = 0;

    $(document).mouseleave(function () {
        if (mouseY < 100 && localStorage.getItem('popupModal') != 'shown') {
          $('#popupModal').modal('show');
        }
          localStorage.setItem('popupModal', 'shown');
    });
  });
Domizio Demichelis
@ddnexus
man!
Ben
@yosupgurl
I temporarily removed the renders for troubleshooting, when the render is in the code i get a "failed to build from rails-erb-loader: error
Domizio Demichelis
@ddnexus
I told you to put the thing as it is in the example
sorry, I cannot help you further. I suggest you follow exactly the example, WITHOUT changing anything, not even renaming anything. And use the files and their name as they are in the example
the example works, so you should be able to make it work
after that do your changes and troubleshoot it
Ben
@yosupgurl
$('#records_table').append("<%=j :partial => 'partials/gallery_items' %>"); $('#div_next_link').html("<%=j render :partial => 'partials/next_link' %>"); Pagy.init(document.getElementById('container')); like this?
Domizio Demichelis
@ddnexus
yes sir
Ben
@yosupgurl
sorry man, i'm just so confused. I've tried so many things at this point
Uncaught Error: Module build failed (from ./node_modules/rails-erb-loader/index.js): Error: rails-erb-loader failed with code: 1
Domizio Demichelis
@ddnexus
ok, so please, debug that first
but it's better you start new with the example or you will never get it done
Ben
@yosupgurl
Mhhm, i've created a separate app for debugging. My issue lies somewhere with the rails-erb-loader.
I can render .erb just not .erb partials in the JS.
Domizio Demichelis
@ddnexus
rails erb loader is part of webpack
Ben
@yosupgurl
thnx for the help though.
Domizio Demichelis
@ddnexus
replace the erb line wih the actual content to try
but add the export and global too
I will have time tomorrow. good luck
Ben
@yosupgurl
module build failed again.
no worries, thanks for the help. I'll keep digging
Nathan Elmore
@elmoren
Am I able to set the total count when calling pagy() manually? I'm using pagy with a handful of aggregations, and when I do order by aggregation, pagy's count query says that aggregation doesn't exist
I might just end up using Countless
Nathan Elmore
@elmoren
I found the info I needed in the "Paginate any Collection" of your docs. Sorry about that