简体   繁体   English

Shopify /液体相关

[英]Shopify/Liquid related

I'd like to know how I could possibly rearrange the order of a list in Shopify. 我想知道如何在Shopify中重新排列列表的顺序。 Now please do note that I have to use the default methods in Liquid as my boss doesn't let me create my own ones. 现在请注意,由于老板不允许我创建自己的方法,因此我必须在Liquid中使用默认方法。 And I also need to override the default order which is set in the admin panel. 而且,我还需要覆盖在管理面板中设置的默认顺序。 So is there a way to override it or how could I do it in Javascript? 那么有没有一种方法可以覆盖它,或者我该如何用Javascript来实现呢? Thanks in advance, regards. 在此先感谢,问候。

[SOLUTION] I used the tinysort JQuery plugin ( http://tinysort.sjeiti.com/ ) [解决方案]我使用了tinysort JQuery插件( http://tinysort.sjeiti.com/

$(document).ready(function() {
  $('table.tables').tsort({data:'price', order:'asc'});
});

This is if you have tables with the class "tables" and with the attribute data-price. 如果您的表具有“ tables”类,并且具有data-price属性。 The .ready is so that all DOMs and everything will be loaded before we execute the sorting. .ready可以在执行排序之前加载所有DOM和所有内容。 Hope someone will find this helpful. 希望有人会对此有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM