Welcome, Guest. Please login or register.

Author Topic: Choose column order on listings  (Read 514 times)

joserra

  • Newbie
  • *
  • Posts: 15
    • View Profile
Choose column order on listings
« on: July 06, 2016, 11:15:27 AM »
Hi all,

I have created a simple "plugin" for NeDio14 allowing to choose column order on listings.
Now you can select which columns will appear on report and their order on listing too.

Pluginīs dialog is fired up when a new "Order" button, located near to selected fields, is pressed (another event could be used - listbox doubleclick, ...).

Pluginīs dialog contains a typical set of controls for this function:

  - A listbox containing all available fields on listing
  - A selected fields listbox
  - Buttons to rearrange fields order on second listbox : top, bottom, up, down.

Fields can be moved from one listbox to another one using double-click.
Multiple field selection can be used to move options between listbox and to rearrange order on selected fields listbox.
Adding fields on second listbox is made after last selected field on that listbox (or at the end if no one is selected) allowing to insert elements in the middle of listbox.

Attached are the following files:

  - inc/zChooseOrder.js : Javascript file implementing pluginīs dialog
  - inc/zChooseOrder.css : Stylesheet (sorry is very poor)
  - Nodes-List2.php : NEDIO14īs Node-List program modified to use plugin
  - NodeList-ColumnOrder.png : Choose Column Order dialog in action

Code modifications on Node-List2.php are delimited by HTML comments:

  - Block 1 : Construction of selected fields listbox and button to start plugin. It could be moved to a function on libmisc.php for better organization.
  - Block 2 : The selected fields' loop.
  - Block 3 : Special columns outside the loop (deleted elementīs log).

I hope it will be interesting for anyone else.

Regards,

JoSerra



rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2500
    • View Profile
    • NeDi
Re: Choose column order on listings
« Reply #1 on: July 06, 2016, 07:46:55 PM »
Cool, thanks for this :)

One of the drawbacks of NOT using a javascript framework in NeDi is the static HTML representation. This might be a valuable work around...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo