Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 05/09/2017 BIG Autumn SALE

    Use AUTUMN17 coupon code to buy our WordPress or Joomla! extensions with 25% discount. Hurry up! The offer is valid till 11 September.

  • 14/04/2017 Happy Easter

    Wish a Happy Easter and give 30% discount for all our WordPress and Joomla! extensions. Use EASTER17 coupon code. The offer is valid till 17 April.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Sorting Bible verses
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: Sorting Bible verses
#60004
Sorting Bible verses 6 Months, 4 Weeks ago Karma: 0
Hello,

Is there a way to sort correctly Bible verses in ARI Data Tables without having a separate column for chapter and verse?

For example the correct order of verses should be:
1.3
1.7
1.15
1.27
1.28

But with numeric sorting, it ends up like this:
1.15
1.27
1.28
1.3
1.7

I have also tried sorting by string, separating chapters and verses with : instead of . but that didn't work either.

And by the way, I can't find any information anywhere about what is the difference between numeric, numeric HTML and numeric (advanced) sorting.

Thanks,

AV
The administrator has disabled public write access.
 
#60007
Re:Sorting Bible verses 6 Months, 4 Weeks ago Karma: 667
Hello,

Your requirement requires a specific sorting rule, we can implement it as a custom development.

About difference between "Numeric", "Numeric HTML" and "Numeric (Advanced)" sorting types. "Numeric" is used if numbers are stored in plain format (like 2, 5 and etc.), "Numeric HTML" is used when values contain some prefix, postfix and etc., in this case all non-numeric characters (excluding - and .) will be removed before sorting, "Number (Advanced)" is used for float numbers.

BTW, If you don't need "Numeric HTML" sorting then you can modify <joomla_directory>/modules/mod_aridatatables/includes/js/widgets/datatables/js/jquery.dataTables.extra.js file and replace the following code:

Code:


var x = a.replace(/[^-.0-9]/g, "");
var y = b.replace(/[^-.0-9]/g, "");



with the following one:

Code:


var x = a.replace(/[^-.0-9]/g, "");
var y = b.replace(/[^-.0-9]/g, "");



and use "Numeric HTML" type to sort Bible verses.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#60008
Re:Sorting Bible verses 6 Months, 4 Weeks ago Karma: 0
Thanks very much for your answer... but unless I'm missing something, it looks like the two code snippets you provided are exactly identical!
The administrator has disabled public write access.
 
#60009
Re:Sorting Bible verses 6 Months, 4 Weeks ago Karma: 667
Sorry, replace it with the following code:

Code:


var x = a.replace(/[^-0-9]/g, "");
var y = b.replace(/[^-0-9]/g, "");



Regards,
ARI Soft
The administrator has disabled public write access.
 
#60010
Re:Sorting Bible verses 6 Months, 4 Weeks ago Karma: 0
Thank you. I have changed the code but it doesn't work. The table seems to just ignore the colon and read the numbers as whole numbers. So it ends up like this:

1:3
2:1
5:1
6:9
7:3
10:6
10:9
1:17
11:9
12:2
1:28
etc.

See here: www.catholicsforisrael.com/resources/613-mitzvot


Is it necessary that chapters and verses be separated by a period . or can they be separated by a colon : instead?

(The colon would be the better option)
Last Edit: 2017/03/27 08:57 By andreville.
The administrator has disabled public write access.
 
#60013
Re:Sorting Bible verses 6 Months, 4 Weeks ago Karma: 667
In your first post you use . symbol as separator in verses so we provided the solution for this format.

Values with : symbol should be sorted as float numbers?

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 12