NetTalk Central

Author Topic: sort column (disconnected web)  (Read 2239 times)

agustinh2000

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • Email
sort column (disconnected web)
« on: February 10, 2021, 06:10:58 AM »
Hi Guys,
I'm working on a disconnected web and I need to sort the data by one column in ascending order
(it's column with numbers I show in the screenshot below)

I set it up in the "sort" tab of that column but it doesn't work. Should I do it with jquery?
I'd greatly appreciate you help!
Thanks!
Agustin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11179
    • View Profile
Re: sort column (disconnected web)
« Reply #1 on: February 10, 2021, 11:11:48 PM »
Hi Agustin,
I would need to see an example app to comment on what you are doing, or why it might not be working.
Could be any number of things...

cheers
Bruce

agustinh2000

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • Email
Re: sort column (disconnected web)
« Reply #2 on: February 11, 2021, 05:49:48 AM »
Hi Bruce, thanks for your answer.
I can use the DisconnetedWeb example (attached below) to clarify my previous question. In this case, I'd want to sort (e.g in ascending order) the InvoiceNumber field which currently appears seemingly 'random' (2,1,3). I set it up in the "sort" tab but it doesn't seem to work. Am I missing something? Do you know what can I do to solve this?

Thanks much!
Agustin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11179
    • View Profile
Re: sort column (disconnected web)
« Reply #3 on: February 14, 2021, 10:10:26 PM »
Hi Agustin,

I tried it out, and after fixing one issue in the example [1], I was able to get it running.
the Invoice.tps file you included was blank (maybe because of the bug?) - so I added some records, but it behaved itself.

[1] SyncInvoice procedure, Returns tab, InvoiceView,
Include Prefixes should be OFF

cheers
Bruce

agustinh2000

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • Email
Re: sort column (disconnected web)
« Reply #4 on: February 15, 2021, 08:39:30 AM »
thanks Bruce.
it worked!!!

agustinh2000

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • Email
Re: sort column (disconnected web)
« Reply #5 on: February 17, 2021, 03:01:36 PM »
Bruce, I was able to sort the column out, but it takes the data as string (see screenshot) rather than short (which is how it's defined in the dictionary). Do I need to set it up in the p_web.SetOption or there's any other way?

p_web.SetOption(loc:options,'orderBy','"' & lower('field_number') & '"')

Thanks!
Cheers,
Agustin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11179
    • View Profile
Re: sort column (disconnected web)
« Reply #6 on: February 17, 2021, 10:19:22 PM »
an updated example of what you have so far, along with an invoice.tps file will probably be helpful in answering this.

Cheers
Bruce

agustinh2000

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • Email
Re: sort column (disconnected web)
« Reply #7 on: February 18, 2021, 03:57:54 AM »
Thanks Bruce,
please find here the example. It does sort the column but as a string (1,10,2,3 etc) but it's defined as long.
« Last Edit: February 18, 2021, 04:26:10 AM by agustinh2000 »