Skip to content

Commit

Permalink
DataTable samples rename, move, update.
Browse files Browse the repository at this point in the history
  • Loading branch information
abrudz committed Sep 19, 2016
1 parent 8ed553b commit 10253e0
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 69 deletions.
37 changes: 0 additions & 37 deletions SampleMiSites/MS3/Examples/DC/DatatablesAdvanced_CFW1.mipage

This file was deleted.

47 changes: 23 additions & 24 deletions SampleMiSites/MS3/Examples/Data/TeamDyalog.csv
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
Name;Based in;Joined;Title
Gitte;DK;2005/04;Managing Director / CEO
Morten;DK;2005/04;Evangelist / CXO
Ad�m;CA;2015/05;Developer
Andy;UK;1987/07;Operations Manager / COO
Bj�rn;DK;2005/04;Developer
Brian;USA;2011/03;APL Tools Group Manager
Dan;CA;2006/01;Tester, teacher, writer
Fiona;UK;2013/04;Documentation Manager
Geoff;UK;1977/01;Radical
Helene;DK;2005/04;Finance Manager (CFO)
Jason;UK;2007/05;IT Manager
Jay;UK;2010/04;Technical Director / CTO
JohnD;UK;1991/09;Chief Architect
JohnS;UK;1981/07;Founder & Old hand
Karen;UK;1992/05;Customer Account Manager
Nadine;DK;2014/05;Communication
Nic;F;2006/08;Developer
Nick;UK;2014/01;Developer
Pete;GR;1977/09;Founder & Bouzuki-Player
Richard;UK;2008/06;Development Manager
Roger;CA;2011/01;Aesthetic Thinking
Vibeke;UK;2006/02;PR & Marketing Guru
Vince;UK;1996/06;Support
Name,Based in,Month,Year
Gitte,Denmark,April,2005
Morten,Denmark,April,2005
Ad�m,United Kingdom,May,2015
Andy,United Kingdom,July,1987
Bj�rn,Denmark,April,2005
Brian,USA,March,2011
Dan,Canada,January,2006
Fiona,United Kingdom,April,2013
Geoff,United Kingdom,January,1977
Helene,Denmark,April,2005
Jason,United Kingdom,May,2007
Jay,United Kingdom,April,2010
JohnD,United Kingdom,September,1991
JohnS,United Kingdom,July,1981
Karen,United Kingdom,May,1992
Nic,France,August,2006
Nick,United Kingdom,January,2014
Pete,Greece,September,1977
Richard,United Kingdom,June,2008
Roger,Canada,January,2011
Vibeke,United Kingdom,February,2006
Vince,United Kingdom,June,1996
31 changes: 31 additions & 0 deletions SampleMiSites/MS3/Examples/JS/DataTableAdvanced.mipage
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
:Class DataTableAdvanced : MiPageSample
⍝ Control:: _JS.DataTable
⍝ Description:: DataTable with options plus "ColumnFilterWidget" and "SearchHighlight" plug-ins

:field private Datafile←'TeamDyalog.csv'

∇ Compose;dyalog;dPath;dat;dt
:Access Public

Add MarkdownFollows
⍝ In this example we are using two plug-ins to enhance our DataTable:
⍝ - **SearchHighlight** highlights the searched-for phrase in each result (try typing *mar* into the search box)
⍝ - **ColumnFilterWidgets** adds dropdown list-boxes for selection of filtering criteria. You can remove any item by clicking on it.
⍝ - Note how the **dom** option is used to hide the page switching buttons -- only
⍝ one page of data (limited to the default of 10 records) is shown

dPath←_Request.Server.Config.AppRoot,'examples/data/'
:If 0=⎕NC'#.LoadData'
dyalog←2 ⎕NQ'.' 'GetEnvironment' 'dyalog'
#.⎕CY dyalog,'/ws/loaddata' ⍝ must be copied to root because of absolute reference #.fileUtilities
:EndIf

dat←#.LoadTEXT dPath,Datafile ⍝ get Data from CSV
dt←'#sample'Add _.DataTable dat'' 1 '' 0 0 ⍝ add table to the page with that data
dt.Options.dom←'Wfrtip' ⍝ with "W"-Option for the CFW-Widget
dt.Options.searchHighlight←_true ⍝ Brian: should't #.JSON.true be useable in such cases? It is not. Is there another tool for that?


:EndClass
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
∇ Compose;data;dt
:Access Public

Add _.h2'DataTable'
Add _.p ScriptFollows
⍝ The DataTable widget uses the JS-Library <a href="http://datatables.net/">DataTables</a>
⍝ which provides a very powerful and comprehensive rendering tool for tabular data.

Add _.h2'Health Care Spending by Country'
Add _.p ScriptFollows
⍝ Data on this page was taken from the <a href="https://www.cia.gov/library/publications/the-world-factbook/rankorder/2225rank.html">CIA World Factbook</a>.
Add MarkdownFollows
⍝ Data on this page was taken from the [CIA World Factbook](https://www.cia.gov/library/publications/the-world-factbook/rankorder/2225rank.html).

⍝ [;1] country [;2] % GDP [;3] population [;4] GDP [;5] $/capita
data←1 #.Files.FREAD #.Boot.AppRoot,'Examples/Data/stats.DCF'
Expand All @@ -23,4 +18,3 @@

:EndClass

0 comments on commit 10253e0

Please sign in to comment.