java.net: Wiki

The Source for Java Technology Collaboration


 <<O>>  Difference Topic JMakiTableDataModel (49 - 30 May 2008 - Main.carlavmott)
Line: 1 to 1
 Main Model page

jMaki Table Data Model

Line: 49 to 49
  object :: = "object :" ""
Changed:
<
<
>
>
JSON Schema formate :
{
       "description" : "jMaki DataTable",
         "type":"object",
         "properties": { 
          "columns" : {
             "type" : "array",
               "items" : { 
                 "type" : "object", 
                 "properties" : {
                    "id" : {"type": "string", "optional":true,},
                  "label" : {"type": "string"}
                 }
               },           
             "type" : "array",
               "rows" : { 
                 "type" : "object", 
                 "properties" : {
                    "id" : {"type": "string", "optional":true,},
                  "label" : {"type": "string"}
                 }
               }
           } 
         }      
  }
 

(1.2) Events

Rows events are published to the topic assigned to the given widget instance. Table events include:


 <<O>>  Difference Topic JMakiTableDataModel (48 - 27 Sep 2007 - Main.gmurray71)
Line: 1 to 1
 Main Model page

jMaki Table Data Model

Line: 57 to 57
 

Subscribe Events

event type argument (object literal)
Changed:
<
<
addRow { value: <row>}]
addRows { value: <rows>]}
>
>
addRow { value: <row>}
addRows { value: [<row>]}
 
clear {}
removeRow {targetId : < rowId>}
select {targetId : < rowId>}
Added:
>
>
updateRow { targetId :<rowId>, value: <row> }
 Subscribe events allow you to manipulate a given instance of a widget. The event names are appended to the the subscribe topic name following a "/". For example "addRow" for a yahoo.dataTable would be "/yahoo/dataTable/addRow"
Line: 95 to 96
  ] });
Added:
>
>
  • clear - Clears all rows

jmaki.publish("/yahoo/dataTable/clear", { });
 
  • removeRow
jmaki.publish("/yahoo/dataTable/removeRow", { targetId : 'foo'});
Line: 102 to 110
 The rowId should be the id of the row you wish to remove.
Changed:
<
<
* clear - Clears all rows
>
>
  • updateRow - Updates the row with the given rowId with the data provided.
 
Changed:
<
<
jmaki.publish("/yahoo/dataTable/clear", { });
>
>
var _data = { title : 'Book Title New', author : 'Author New', isbn : 'New', description : 'A Some long New description'}; jmaki.publish("/table/updateRow", { targetId : "bar", value : _data});
 

Publish Events

Line: 115 to 124
 
Event type Payload Event
onSelect {widgetId : uuid , topic : , type : 'onSelect' , targetId : selected_row} Publshed when a user selects a row.
Changed:
<
<

(1.3) Ext and Yahoo Data Table Extensions

>
>

(1.3) Yahoo Data Table Extensions

TBD in jMaki 1.1

 

Last Modified:

Changed:
<
<
-- Main.gmurray - 1 Aug 2007
>
>
-- Main.gmurray - 27 Sept 2007
 

 <<O>>  Difference Topic JMakiTableDataModel (47 - 01 Aug 2007 - Main.gmurray71)
Line: 1 to 1
 Main Model page

jMaki Table Data Model

Line: 60 to 60
 
addRow { value: <row>}]
addRows { value: <rows>]}
clear {}
Changed:
<
<
removeRow {rowId : < rowId>}
select {rowId : < rowId>}
>
>
removeRow {targetId : < rowId>}
select {targetId : < rowId>}
 Subscribe events allow you to manipulate a given instance of a widget. The event names are appended to the the subscribe topic name following a "/". For example "addRow" for a yahoo.dataTable would be "/yahoo/dataTable/addRow"
Line: 113 to 113
 These are the events published to the "publish" topic associated with a widget.

Event type Payload Event
Changed:
<
<
onSelect {widgetId : uuid , topic : , type : 'onSelect' , value: array of ids of selected rows} Publshed when a user selects a row.
>
>
onSelect {widgetId : uuid , topic : , type : 'onSelect' , targetId : selected_row} Publshed when a user selects a row.
 

(1.3) Ext and Yahoo Data Table Extensions

Last Modified:

Changed:
<
<
-- Main.gmurray - 22 July 2007
>
>
-- Main.gmurray - 1 Aug 2007
 

 <<O>>  Difference Topic JMakiTableDataModel (46 - 28 Jul 2007 - Main.carlavmott)
Line: 1 to 1
 Main Model page

jMaki Table Data Model

Line: 97 to 97
 
  • removeRow
Changed:
<
<
jmaki.publish("/yahoo/dataTable/removeRow", { rowId : 'foo'});
>
>
jmaki.publish("/yahoo/dataTable/removeRow", { targetId : 'foo'});
 

The rowId should be the id of the row you wish to remove.


 <<O>>  Difference Topic JMakiTableDataModel (45 - 25 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 Main Model page

jMaki Table Data Model

Line: 14 to 14
 
{
  columns : [
Changed:
<
<
{id : 'company', label : 'Company'}, {id : 'price', label : 'Price'}, {id : 'change', label : 'Change', {id : 'pchange', label : '% Change'}, {id : 'lupdate', label : 'Last Updated'}
>
>
{id : 'title', label : 'Titile'}, {id : 'author', label : 'Author'}, {id : 'isbn', label : 'Isbn'}, {id : 'description', label : 'Description'}
  ], rows : [ { title : 'Book Title 1',

 <<O>>  Difference Topic JMakiTableDataModel (44 - 23 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 Main Model page

jMaki Table Data Model

Line: 47 to 47
  rows :: = "[" {} "]" row ::= "{" [< rowId >] , ": " [ | ]"}", rowId :: = "rowId :" ""
Changed:
<
<
object :: = "object :" ""
>
>
object :: = "object :" ""
 
Line: 113 to 113
 These are the events published to the "publish" topic associated with a widget.
Changed:
<
<
| Event type | Payload | Event
>
>
Event type Payload Event
 
onSelect {widgetId : uuid , topic : , type : 'onSelect' , value: array of ids of selected rows} Publshed when a user selects a row.

(1.3) Ext and Yahoo Data Table Extensions


 <<O>>  Difference Topic JMakiTableDataModel (43 - 23 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 Main Model page

jMaki Table Data Model

Line: 45 to 45
  column ::= "{ label :" " "id :" "}," columnid :: = , rows :: = "[" {} "]"
Changed:
<
<
row ::= "{" [< rowId >] , ": " "}",
>
>
row ::= "{" [< rowId >] , ": " [ | ]"}",
  rowId :: = "rowId :" ""
Added:
>
>
object :: = "object :" ""
 

 <<O>>  Difference Topic JMakiTableDataModel (42 - 23 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 Main Model page

jMaki Table Data Model

Line: 85 to 85
  { title : 'Book Title 3', author : 'Author 3', isbn: '4415',
Changed:
<
<
description : 'A Some long description'},
>
>
description : 'A Some long description' },
  { title : 'Book Title 4', author : 'Author 4', isbn: '4416',
Changed:
<
<
description : 'A Some long description'}
>
>
description : 'A Some long description' }
  ] });

 <<O>>  Difference Topic JMakiTableDataModel (41 - 23 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 Main Model page

jMaki Table Data Model

Line: 21 to 21
  {id : 'lupdate', label : 'Last Updated'} ], rows : [
Changed:
<
<
{ id : 'r1', company : 'A Co', price : 71.72, change : 0.02, pchange : 0.03, lupdate : '9/1 12:00am' }, {id : 'r2', company : 'B Inc', price : 29.01, change : 0.42, pchange : 1.47, lupdate : '9/1 12:00am' }, { id : 'r3', company : 'C Group Inc', price : 83.81, change : 0.28, pchange : 0.34, lupdate : '9/1 12:00am'
>
>
{ title : 'Book Title 1', author : 'Author 1', isbn: '4412', description : 'A Some long description'
  },
Changed:
<
<
{id : 'r4', company : 'D Company', price : 52.55, change : 0.01, pchange : 0.02, lupdate : '9/1 12:00am' }
>
>
{ id : 'foo', title : 'Book Title 2', author : 'Author 2', isbn: '4414', description : 'A Some long description'}
  ] }
Line: 86 to 67
 
  • addRow - The payload value passed to the widget is added to the end of the table.
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRow", { value : {company : 'A Co', price : 71.72, change : 0.02, pchange : 0.03, lupdate : '9/1 12:00am' }});
>
>
jmaki.publish("/dojo/table/addRow", { value : { title : 'Book Title 3', author : 'Author 3', isbn: '4415', description : 'A Some long description'} });
 

  • addRows - The payload value passed to the widget is added to the the table and the filters will be applied.
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRows", { value: [ {'company' : 'A Co', price : 71.72, change : 0.02, pchange : 0.03, lupdate : '9/1 12:00am' }, {company : 'B Inc', price : 29.01, change : 0.42, pchange : 1.47, lupdate : '9/1 12:00am' }]} );
>
>
jmaki.publish("/dojo/table/addRow", { value : [ { title : 'Book Title 3', author : 'Author 3', isbn: '4415', description : 'A Some long description'}, { title : 'Book Title 4', author : 'Author 4', isbn: '4416', description : 'A Some long description'} ] });
 
  • removeRow
Line: 117 to 100
 The rowId should be the id of the row you wish to remove.
Deleted:
<
<
As of version .9.5.3 To add rows at a given point you can provide an index where to add the rows like the following:

 jmaki.publish("/yahoo/dataTable/addRows", {value : [
     {  title : 'Book Z',
        author : 'Author Z', 
        isbn: '4414',
        description : 'A Some long description'
     }
    ]
});
  * clear - Clears all rows

 <<O>>  Difference Topic JMakiTableDataModel (40 - 23 Jul 2007 - Main.gmurray71)
Line: 1 to 1
Deleted:
<
<
-- Main.gmurray - 14 July 2007
 Main Model page

jMaki Table Data Model

Line: 66 to 64
  column ::= "{ label :" " "id :" "}," columnid :: = , rows :: = "[" {} "]"
Changed:
<
<
row ::= "{" [] , ": " "}", rowid :: = "id :" ""
>
>
row ::= "{" [< rowId >] , ": " "}", rowId :: = "rowId :" ""
 
Line: 78 to 76
 

Subscribe Events

event type argument (object literal)
Changed:
<
<
addRow { data: <row>, [<index>}]
addRows { data: <rows> , [<index>]}
>
>
addRow { value: <row>}]
addRows { value: <rows>]}
 
clear {}
Changed:
<
<
removeRow {index : <rowid>}

index :: = <rowid> | <number>
>
>
removeRow {rowId : < rowId>}
select {rowId : < rowId>}
 Subscribe events allow you to manipulate a given instance of a widget. The event names are appended to the the subscribe topic name following a "/". For example "addRow" for a yahoo.dataTable would be "/yahoo/dataTable/addRow"

  • addRow - The payload value passed to the widget is added to the end of the table.
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRow", { data: {company : 'A Co',
>
>
jmaki.publish("/yahoo/dataTable/addRow", { value : {company : 'A Co',
  price : 71.72, change : 0.02, pchange : 0.03,
Line: 99 to 94
  }});
Changed:
<
<
  • addRows - The payload value passed to the widget is added to the end of the table.
>
>
  • addRows - The payload value passed to the widget is added to the the table and the filters will be applied.
 
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRows", { data: [ {'company' : 'A Co',
>
>
jmaki.publish("/yahoo/dataTable/addRows", { value: [ {'company' : 'A Co',
  price : 71.72, change : 0.02, pchange : 0.03,
Line: 116 to 112
 
  • removeRow
Changed:
<
<
jmaki.publish("/yahoo/dataTable/removeRow", { index : 'foo'});
>
>
jmaki.publish("/yahoo/dataTable/removeRow", { rowId : 'foo'});
 
Changed:
<
<
The index should be the id of the row you wish to remove.
>
>
The rowId should be the id of the row you wish to remove.
 As of version .9.5.3 To add rows at a given point you can provide an index where to add the rows like the following:
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRows", {index : 1, data: [
>
>
jmaki.publish("/yahoo/dataTable/addRows", {value : [
  { title : 'Book Z', author : 'Author Z', isbn: '4414',
Line: 141 to 138
 

Publish Events

Changed:
<
<
event type payload
onSelect {id : uuid , topic : , type : 'onSelect' , data: array of ids of selected rows}
onCellEdit {id: uuid, column:columnid, row: rowid, data: value}
>
>
These are the events published to the "publish" topic associated with a widget.
 
Changed:
<
<

(1.3) Ext and Yahoo Data Table Extensions

The Yahoo dataTable and the Ext Grid provide additional specialization on the core table model which allow for editors and renderers to be added on the individual columns.

{
     columns :[
        {id : 'company', label : 'Company'},
        {id : 'price', label : 'Price', renderer: 'usMoney'},
        {id : 'change', label : 'Change', renderer: 'change'},
        {id : 'pchange', label : '% Change', renderer: 'pctChange'},
        {id : 'lupdate', label : 'Last Updated',renderer: 'italic'}
     ]}
>
>
| Event type | Payload | Event
onSelect {widgetId : uuid , topic : , type : 'onSelect' , value: array of ids of selected rows} Publshed when a user selects a row.
 
Changed:
<
<
With the Yahoo Data Table you can set any given column to not be sortable by setting a sortable property on the column.
>
>

(1.3) Ext and Yahoo Data Table Extensions

 
Deleted:
<
<
{
     columns :[
        {id : 'company', label : 'Company'},
        {id : 'price', label : 'Price', sortable : false},
        {id : 'change', label : 'Change'},
        {id : 'pchange', label : '% Change'},
        {id : 'lupdate', label : 'Last Updated'}
     ]
}
 
Changed:
<
<
In the example above the column with the id price can not be sorted.
>
>
Last Modified:
 
Changed:
<
<
-
>
>
-- Main.gmurray - 22 July 2007
 

 <<O>>  Difference Topic JMakiTableDataModel (39 - 19 Jul 2007 - Main.carlavmott)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007
Added:
>
>
Main Model page
 

jMaki Table Data Model

Line: 59 to 61
 

(1.2) Data Model

Added:
>
>
tabledata ::= "{" [] "}"
  columns ::= "[" {} "]"
Changed:
<
<
column ::= "{" label : "", id : "}," columnid :: = "",
>
>
column ::= "{ label :" " "id :" "}," columnid :: = ,
  rows :: = "[" {} "]"
Changed:
<
<
row ::= "{" [] , : "" "}", rowid :: = id : ""
>
>
row ::= "{" [] , ": " "}", rowid :: = "id :" ""
 
Line: 88 to 91
 
  • addRow - The payload value passed to the widget is added to the end of the table.
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRow", {company : 'A Co',
>
>
jmaki.publish("/yahoo/dataTable/addRow", { data: {company : 'A Co',
  price : 71.72, change : 0.02, pchange : 0.03, lupdate : '9/1 12:00am'
Changed:
<
<
});
>
>
}});
 

  • addRows - The payload value passed to the widget is added to the end of the table.
Line: 109 to 112
  change : 0.42, pchange : 1.47, lupdate : '9/1 12:00am'
Changed:
<
<
}]);
>
>
}]} );
 
  • removeRow
Line: 140 to 143
 
event type payload
onSelect {id : uuid , topic : , type : 'onSelect' , data : array of ids of selected rows}
Changed:
<
<
onCellEdit {id: uuid, column:columnid, row: rowid, value: value}
>
>
onCellEdit {id: uuid, column:columnid, row: rowid, data: value}
 

(1.3) Ext and Yahoo Data Table Extensions


 <<O>>  Difference Topic JMakiTableDataModel (38 - 19 Jul 2007 - Main.carlavmott)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 88 to 88
 
  • addRow - The payload value passed to the widget is added to the end of the table.
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRow", { data : {company : 'A Co',
>
>
jmaki.publish("/yahoo/dataTable/addRow", {company : 'A Co',
  price : 71.72, change : 0.02, pchange : 0.03,

 <<O>>  Difference Topic JMakiTableDataModel (37 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 140 to 140
 
event type payload
onSelect {id : uuid , topic : , type : 'onSelect' , data : array of ids of selected rows}
Changed:
<
<
onUpdate {id: uuid, column:columnid, row: rowid, value: value}
>
>
onCellEdit {id: uuid, column:columnid, row: rowid, value: value}
 

(1.3) Ext and Yahoo Data Table Extensions


 <<O>>  Difference Topic JMakiTableDataModel (36 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 15 to 15
 { columns : [ {id : 'company', label : 'Company'},
Changed:
<
<
{id : 'price', label : price}, {id : 'change', label : change,
>
>
{id : 'price', label : 'Price'}, {id : 'change', label : 'Change',
  {id : 'pchange', label : '% Change'}, {id : 'lupdate', label : 'Last Updated'} ],
Line: 89 to 89
 
  • addRow - The payload value passed to the widget is added to the end of the table.
jmaki.publish("/yahoo/dataTable/addRow", {  data :   {company : 'A Co',
Changed:
<
<
price'
71.72,
>
>
price : 71.72,
  change : 0.02, pchange : 0.03, lupdate : '9/1 12:00am'

 <<O>>  Difference Topic JMakiTableDataModel (35 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 14 to 14
 
{
  columns : [
Changed:
<
<
{id : 'company', 'label' : 'Company'}, {id : 'price', 'label' : 'Price'}, {id : 'change', 'label' : 'Change', {id : 'pchange', 'label' : '% Change'}, {id : 'lupdate', 'label' : 'Last Updated'}
>
>
{id : 'company', label : 'Company'}, {id : 'price', label : price}, {id : 'change', label : change, {id : 'pchange', label : '% Change'}, {id : 'lupdate', label : 'Last Updated'}
  ], rows : [
Changed:
<
<
{ 'id' : 'r1', 'company' : 'A Co', 'price' : 71.72, 'change' : 0.02, 'pchange' : 0.03, 'lupdate' : '9/1 12:00am'
>
>
{ id : 'r1', company : 'A Co', price : 71.72, change : 0.02, pchange : 0.03, lupdate : '9/1 12:00am'
  },
Changed:
<
<
{'id' : 'r2', 'company' : 'B Inc', 'price' : 29.01, 'change' : 0.42, 'pchange' : 1.47, 'lupdate' : '9/1 12:00am'
>
>
{id : 'r2', company : 'B Inc', price : 29.01, change : 0.42, pchange : 1.47, lupdate : '9/1 12:00am'
  }, {
Changed:
<
<
'id' : 'r3', 'company' : 'C Group Inc', 'price' : 83.81, 'change' : 0.28, 'pchange' : 0.34, 'lupdate' : '9/1 12:00am'
>
>
id : 'r3', company : 'C Group Inc', price : 83.81, change : 0.28, pchange : 0.34, lupdate : '9/1 12:00am'
  },
Changed:
<
<
{'id' : 'r4', 'company' : 'D Company', 'price' : 52.55, 'change' : 0.01, 'pchange' : 0.02, 'lupdate' : '9/1 12:00am'
>
>
{id : 'r4', company : 'D Company', price : 52.55, change : 0.01, pchange : 0.02, lupdate : '9/1 12:00am'
  } ] }
Line: 60 to 60
 
    columns ::= "["  {<column>} "]"
Changed:
<
<
column ::= "{" "label : " , "id" : "}," columnid :: = ,
>
>
column ::= "{" label : "", id : "}," columnid :: = "",
  rows :: = "[" {} "]"
Changed:
<
<
row ::= "{" [] , "" : "}", rowid :: = "id : "
>
>
row ::= "{" [] , : "" "}", rowid :: = id : ""
 
Line: 88 to 88
 
  • addRow - The payload value passed to the widget is added to the end of the table.
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRow", { data : {'company' : 'A Co', 'price' : 71.72, 'change' : 0.02, 'pchange' : 0.03, 'lupdate' : '9/1 12:00am'
>
>
jmaki.publish("/yahoo/dataTable/addRow", { data : {company : 'A Co',
price'
71.72, change : 0.02, pchange : 0.03, lupdate : '9/1 12:00am'
  });

  • addRows - The payload value passed to the widget is added to the end of the table.
jmaki.publish("/yahoo/dataTable/addRows", { data : [   {'company' : 'A Co',
Changed:
<
<
'price' : 71.72, 'change' : 0.02, 'pchange' : 0.03, 'lupdate' : '9/1 12:00am'
>
>
price : 71.72, change : 0.02, pchange : 0.03, lupdate : '9/1 12:00am'
  },
Changed:
<
<
{'company' : 'B Inc', 'price' : 29.01, 'change' : 0.42, 'pchange' : 1.47, 'lupdate' : '9/1 12:00am'
>
>
{company : 'B Inc', price : 29.01, change : 0.42, pchange : 1.47, lupdate : '9/1 12:00am'
  }]);
  • removeRow
Line: 149 to 149
 
{
     columns :[
Changed:
<
<
{'id' : 'company', 'label' : 'Company'}, {'id' : 'price', 'label' : 'Price', renderer: 'usMoney'}, {'id' : 'change', 'label' : 'Change', renderer: 'change'}, {'id' : 'pchange', 'label' : '% Change', renderer: 'pctChange'}, {'id' : 'lupdate', 'label' : 'Last Updated',renderer: 'italic'}
>
>
{id : 'company', label : 'Company'}, {id : 'price', label : 'Price', renderer: 'usMoney'}, {id : 'change', label : 'Change', renderer: 'change'}, {id : 'pchange', label : '% Change', renderer: 'pctChange'}, {id : 'lupdate', label : 'Last Updated',renderer: 'italic'}
  ]}
Line: 162 to 162
 
{
     columns :[
Changed:
<
<
{'id' : 'company', 'label' : 'Company'}, {'id' : 'price', 'label' : 'Price', sortable : false}, {'id' : 'change', 'label' : 'Change'}, {'id' : 'pchange', 'label' : '% Change'}, {'id' : 'lupdate', 'label' : 'Last Updated'}
>
>
{id : 'company', label : 'Company'}, {id : 'price', label : 'Price', sortable : false}, {id : 'change', label : 'Change'}, {id : 'pchange', label : '% Change'}, {id : 'lupdate', label : 'Last Updated'}
  ] }

 <<O>>  Difference Topic JMakiTableDataModel (34 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 75 to 75
 

Subscribe Events

event type argument (object literal)
Changed:
<
<
addRow { data : <rows>, [<index>}]
addRows { data : <row> , [<index>]}
>
>
addRow { data : <row>, [<index>}]
addRows { data : <rows> , [<index>]}
 
clear {}
removeRow {index : <rowid>}

 <<O>>  Difference Topic JMakiTableDataModel (33 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 157 to 157
  ]}
Changed:
<
<
With the Yahoo Data Table you can set any given column to not be sortable by setting a sortable property on the column..
>
>
With the Yahoo Data Table you can set any given column to not be sortable by setting a sortable property on the column.
 
{

 <<O>>  Difference Topic JMakiTableDataModel (32 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Deleted:
<
<
--+++ (1.1) Examples
 

Using Array of objects as Rows


 <<O>>  Difference Topic JMakiTableDataModel (31 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 89 to 89
 
  • addRow - The payload value passed to the widget is added to the end of the table.
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRow", { index : 1, data : {'company' : 'A Co',
>
>
jmaki.publish("/yahoo/dataTable/addRow", { data : {'company' : 'A Co',
  'price' : 71.72, 'change' : 0.02, 'pchange' : 0.03,
Line: 99 to 99
 
  • addRows - The payload value passed to the widget is added to the end of the table.
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRows", { index : 1, data : [ {'company' : 'A Co',
>
>
jmaki.publish("/yahoo/dataTable/addRows", { data : [ {'company' : 'A Co',
  'price' : 71.72, 'change' : 0.02, 'pchange' : 0.03,
Line: 122 to 122
 As of version .9.5.3 To add rows at a given point you can provide an index where to add the rows like the following:
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRows", {index : 1, data : [{ title : 'Book Title y', author : 'Author 2', isbn: '4412', description : 'A Some long description'}]})
>
>
jmaki.publish("/yahoo/dataTable/addRows", {index : 1, data : [ { title : 'Book Z', author : 'Author Z', isbn: '4414', description : 'A Some long description' } ] });
 

* clear - Clears all rows

Line: 151 to 158
  ]}
Changed:
<
<
Renderers and Editors are provided as public functions in the widgets.
>
>
With the Yahoo Data Table you can set any given column to not be sortable by setting a sortable property on the column..

{
     columns :[
        {'id' : 'company', 'label' : 'Company'},
        {'id' : 'price', 'label' : 'Price', sortable : false},
        {'id' : 'change', 'label' : 'Change'},
        {'id' : 'pchange', 'label' : '% Change'},
        {'id' : 'lupdate', 'label' : 'Last Updated'}
     ]
}

In the example above the column with the id price can not be sorted.

 -

 <<O>>  Difference Topic JMakiTableDataModel (30 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 76 to 76
 

Subscribe Events

event type argument (object literal)
Changed:
<
<
addRow {<rows>, [<index>}]
addRows { <row> , [<index>]}
>
>
addRow { data : <rows>, [<index>}]
addRows { data : <row> , [<index>]}
 
clear {}
removeRow {index : <rowid>}

 <<O>>  Difference Topic JMakiTableDataModel (29 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 76 to 76
 

Subscribe Events

event type argument (object literal)
Changed:
<
<
addRow <rows>, [<index>]
addRows <row> , [<index>]
clear  
removeRow index : <rowid>
>
>
addRow {<rows>, [<index>}]
addRows { <row> , [<index>]}
clear {}
removeRow {index : <rowid>}
 
index :: = <rowid> | <number>

 <<O>>  Difference Topic JMakiTableDataModel (28 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 75 to 75
 

Subscribe Events

Changed:
<
<
event type payload
>
>
event type argument (object literal)
 
addRow <rows>, [<index>]
addRows <row> , [<index>]
clear  

 <<O>>  Difference Topic JMakiTableDataModel (27 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Changed:
<
<

(1.1) Examples

>
>
--+++ (1.1) Examples
 

Using Array of objects as Rows

Line: 73 to 73
 Rows events are published to the topic assigned to the given widget instance. Table events include:
Added:
>
>

Subscribe Events

 
event type payload
addRow <rows>, [<index>]
addRows <row> , [<index>]
Line: 82 to 84
 
index :: = <rowid> | <number>
Deleted:
<
<

Subscribe Events

 Subscribe events allow you to manipulate a given instance of a widget. The event names are appended to the the subscribe topic name following a "/". For example "addRow" for a yahoo.dataTable would be "/yahoo/dataTable/addRow"
Line: 121 to 122
 As of version .9.5.3 To add rows at a given point you can provide an index where to add the rows like the following:
Deleted:
<
<
jmaki.addGlueListener("/yahoo/button/*", function(payload){
  jmaki.publish("/yahoo/dataTable/addRows", {index : 1, data : [{ title : 'Book Title y', author : 'Author 2', isbn: '4412', description : 'A Some long description'}]})
Deleted:
<
<
});
 

* clear - Clears all rows

Line: 133 to 132
 

Publish Events

Changed:
<
<
  • onSelect - Payload is {id : , topic : , type : 'onSelect' , data : }

You will need to assign ids to the given rows for you to detect select events.

  • onUpdate
>
>
event type payload
onSelect {id : uuid , topic : , type : 'onSelect' , data : array of ids of selected rows}
onUpdate {id: uuid, column:columnid, row: rowid, value: value}
 
Changed:
<
<

(1.1) Ext and Yahoo Data Table Extensions

>
>

(1.3) Ext and Yahoo Data Table Extensions

 The Yahoo dataTable and the Ext Grid provide additional specialization on the core table model which allow for editors and renderers to be added on the individual columns.

 <<O>>  Difference Topic JMakiTableDataModel (26 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 74 to 74
 Rows events are published to the topic assigned to the given widget instance. Table events include:

event type payload
Changed:
<
<
addRow <rows>, []
addRows <row> , []
>
>
addRow <rows>, [<index>]
addRows <row> , [<index>]
 
clear  
removeRow index : <rowid>

 <<O>>  Difference Topic JMakiTableDataModel (25 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 79 to 79
 
clear  
removeRow index : <rowid>
Added:
>
>
 index :: = |
Added:
>
>
 

Subscribe Events

Subscribe events allow you to manipulate a given instance of a widget. The event names are appended to the the subscribe topic name following a "/". For example "addRow" for a yahoo.dataTable would be "/yahoo/dataTable/addRow"


 <<O>>  Difference Topic JMakiTableDataModel (24 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 74 to 74
 Rows events are published to the topic assigned to the given widget instance. Table events include:

event type payload
Changed:
<
<
addRow <row>
>
>
addRow <rows>, []
addRows <row> , []
 
clear  
Changed:
<
<
removeRow indexzx : <rowid>
>
>
removeRow index : <rowid>
 
Added:
>
>
index :: = |
 

Subscribe Events

Subscribe events allow you to manipulate a given instance of a widget. The event names are appended to the the subscribe topic name following a "/". For example "addRow" for a yahoo.dataTable would be "/yahoo/dataTable/addRow"


 <<O>>  Difference Topic JMakiTableDataModel (23 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 76 to 76
 
event type payload
addRow <row>
clear  
Changed:
<
<
removeRow rowid
>
>
removeRow indexzx : <rowid>
 

Subscribe Events


 <<O>>  Difference Topic JMakiTableDataModel (22 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 74 to 74
 Rows events are published to the topic assigned to the given widget instance. Table events include:

event type payload
Changed:
<
<
addRow
>
>
addRow <row>
 
clear  
removeRow rowid

 <<O>>  Difference Topic JMakiTableDataModel (21 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

jMaki Table Data Model

Line: 73 to 73
 Rows events are published to the topic assigned to the given widget instance. Table events include:
Added:
>
>
event type payload
addRow
clear  
removeRow rowid
 

Subscribe Events


 <<O>>  Difference Topic JMakiTableDataModel (20 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007
Changed:
<
<

r jMaki Table Data Model

>
>

jMaki Table Data Model

 
Line: 68 to 68
  rowid :: = "id : "
Deleted:
<
<
--+++Row Events
 
Changed:
<
<
Note these events are still under development and are not all available as of the .9.4 release. We plan to add these soon
>
>

(1.2) Events

 Rows events are published to the topic assigned to the given widget instance. Table events include:

 <<O>>  Difference Topic JMakiTableDataModel (19 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

r jMaki Table Data Model

Changed:
<
<
Example of the data model for release .9.5
>
>
 

(1.1) Examples


 <<O>>  Difference Topic JMakiTableDataModel (18 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

r jMaki Table Data Model

Line: 68 to 68
  rowid :: = "id : "
Added:
>
>
--+++Row Events

Note these events are still under development and are not all available as of the .9.4 release. We plan to add these soon

Rows events are published to the topic assigned to the given widget instance. Table events include:

 

Subscribe Events

Line: 142 to 149
 Renderers and Editors are provided as public functions in the widgets.
Changed:
<
<

Row Events

Note these events are still under development and are not all available as of the .9.4 release. We plan to add these soon

Rows events are published to the topic assigned to the given widget instance. Table events include:

>
>
-
 

 <<O>>  Difference Topic JMakiTableDataModel (17 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

r jMaki Table Data Model

Line: 57 to 57
 You can provide the column names as a property of the args or you can combine the columns and rows into a single object and pass it to the widget as a service or the value. The row id on a given row will be automatically assigned if not provided. It is recommended you provide ids with the rows so they can be later updated or removed.
Changed:
<
<

(1.1) Data Model

>
>

(1.2) Data Model

 
    columns ::= "["  {<column>} "]"
Line: 68 to 68
  rowid :: = "id : "
Deleted:
<
<

Ext and Yahoo Data Table Renderers

The Yahoo dataTable and the Ext Grid provide additional specialization on the core table model which allow for editors and renderers to be added on the individual columns.

{
     columns :[
        {'id' : 'company', 'label' : 'Company'},
        {'id' : 'price', 'label' : 'Price', renderer: 'usMoney'},
        {'id' : 'change', 'label' : 'Change', renderer: 'change'},
        {'id' : 'pchange', 'label' : '% Change', renderer: 'pctChange'},
        {'id' : 'lupdate', 'label' : 'Last Updated',renderer: 'italic'}
     ]}

Renderers and Editors are provided as public functions in the widgets.

Row Events

Note these events are still under development and are not all available as of the .9.4 release. We plan to add these soon

Rows events are published to the topic assigned to the given widget instance. Table events include:

 

Subscribe Events

Line: 147 to 125
  You will need to assign ids to the given rows for you to detect select events.

  • onUpdate
Added:
>
>

(1.1) Ext and Yahoo Data TableExtensions?

The Yahoo dataTable and the Ext Grid provide additional specialization on the core table model which allow for editors and renderers to be added on the individual columns.

{
     columns :[
        {'id' : 'company', 'label' : 'Company'},
        {'id' : 'price', 'label' : 'Price', renderer: 'usMoney'},
        {'id' : 'change', 'label' : 'Change', renderer: 'change'},
        {'id' : 'pchange', 'label' : '% Change', renderer: 'pctChange'},
        {'id' : 'lupdate', 'label' : 'Last Updated',renderer: 'italic'}
     ]}

Renderers and Editors are provided as public functions in the widgets.

Row Events

Note these events are still under development and are not all available as of the .9.4 release. We plan to add these soon

Rows events are published to the topic assigned to the given widget instance. Table events include:

 

 <<O>>  Difference Topic JMakiTableDataModel (16 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

r jMaki Table Data Model

Line: 22 to 22
  {id : 'lupdate', 'label' : 'Last Updated'} ], rows : [
Changed:
<
<
{'company' : 'A Co',
>
>
{ 'id' : 'r1', 'company' : 'A Co',
  'price' : 71.72, 'change' : 0.02, 'pchange' : 0.03, 'lupdate' : '9/1 12:00am' },
Changed:
<
<
{'company' : 'B Inc',
>
>
{'id' : 'r2', 'company' : 'B Inc',
  'price' : 29.01, 'change' : 0.42, 'pchange' : 1.47, 'lupdate' : '9/1 12:00am' },
Changed:
<
<
{'company' : 'C Group Inc',
>
>
{ 'id' : 'r3', 'company' : 'C Group Inc',
  'price' : 83.81, 'change' : 0.28, 'pchange' : 0.34, 'lupdate' : '9/1 12:00am' },
Changed:
<
<
{'company' : 'D Company',
>
>
{'id' : 'r4', 'company' : 'D Company',
  'price' : 52.55, 'change' : 0.01, 'pchange' : 0.02,
Line: 50 to 55
 }
Changed:
<
<
You can provide the column names as a property of the args or you can combine the columns and rows into a single object and pass it to the widget as a service or the value.
>
>
You can provide the column names as a property of the args or you can combine the columns and rows into a single object and pass it to the widget as a service or the value. The row id on a given row will be automatically assigned if not provided. It is recommended you provide ids with the rows so they can be later updated or removed.
 

(1.1) Data Model


 <<O>>  Difference Topic JMakiTableDataModel (15 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

r jMaki Table Data Model

Line: 9 to 9
 

Using Array of objects as Rows

Changed:
<
<
The rows should be an array of objects that are keyed to the column names:

 columns :[
   {id : 'company', 'label' : 'Company'}, 
   {id : 'price', 'label' : 'Price'}, 
   {id : 'change', 'label' : 'Change', 
   {id : 'pchange', 'label' : '% Change'}, 
   {id : 'lupdate', 'label' : 'Last Updated'}
]

The column names need a unique id which is then used in the data to associate it with a given row. The rows would be defined as an array of objects where the property names match the ids given for any given column id.

[
   {'company' : 'A Co',
      'price' : 71.72,
      'change' : 0.02,
      'pchange' : 0.03,
      'lupdate' : '9/1 12:00am'
     },
     {'company' : 'B Inc',
      'price' : 29.01,
      'change' : 0.42,
      'pchange' : 1.47,
      'lupdate' : '9/1 12:00am'
     }, 
     {'company' : 'C Group Inc',
      'price' : 83.81,
      'change' : 0.28,
      'pchange' : 0.34,
      'lupdate' : '9/1 12:00am'
     }, 
     {'company' : 'D Company',
      'price' : 52.55,
      'change' : 0.01,
      'pchange' : 0.02,
      'lupdate' : '9/1 12:00am'
     }                              
]

This you can provide the column names as a property of the args or you can combine the columns and rows into a single object and pass it to the widget as a service or the value. The rows need to be provided as the value or via a service. For example:

>
>
The rows should be an array of objects that are keyed to the column names. The column names need a unique id which is then used in the data to associate it with a given row. The rows are defined as an array of objects where the property names match the ids given for any given column id.
 
{
Line: 93 to 51
 
Added:
>
>
You can provide the column names as a property of the args or you can combine the columns and rows into a single object and pass it to the widget as a service or the value.
 

(1.1) Data Model


 <<O>>  Difference Topic JMakiTableDataModel (14 - 18 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007
Changed:
<
<

Discussion for jMaki Table Data Model

>
>

r jMaki Table Data Model

 Example of the data model for release .9.5
Added:
>
>

(1.1) Examples

 

Using Array of objects as Rows

Line: 92 to 93
 
Added:
>
>

(1.1) Data Model

    columns ::= "["  {<column>} "]"
    column ::=  "{" "label : "  <string>,  "id" : <columnid> "},"
    columnid :: = <string>,
    rows :: = "["  {<row>} "]"
    row ::=  "{" [<rowid>] ,  "<columnid>"  :  <string> "}",
    rowid :: = "id : " <string>
 

Ext and Yahoo Data Table Renderers

The Yahoo dataTable and the Ext Grid provide additional specialization on the core table model which allow for editors and renderers to be added on the individual columns.


 <<O>>  Difference Topic JMakiTableDataModel (13 - 17 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

Discussion for jMaki Table Data Model

Line: 146 to 146
 
  • removeRow
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRow", { index : 0 });
>
>
jmaki.publish("/yahoo/dataTable/removeRow", { index : 'foo'});
 
Added:
>
>
The index should be the id of the row you wish to remove.

As of version .9.5.3 To add rows at a given point you can provide an index where to add the rows like the following:

jmaki.addGlueListener("/yahoo/button/*", function(payload){
    jmaki.publish("/yahoo/dataTable/addRows", {index : 1, data : [{  title : 'Book Title y', author : 'Author 2', isbn: '4412', description : 'A Some long description'}]})
    });
  * clear - Clears all rows
jmaki.publish("/yahoo/dataTable/clear", { });
Changed:
<
<

TBD Subscribe Events

>
>

Publish Events

 
Changed:
<
<
  • insertRow - (not yet implemented)
>
>
  • onSelect - Payload is {id : , topic : , type : 'onSelect' , data : }
 
Changed:
<
<

Publish Events

>
>
You will need to assign ids to the given rows for you to detect select events.
 
Deleted:
<
<
  • onSelect
 
  • onUpdate

 <<O>>  Difference Topic JMakiTableDataModel (12 - 15 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 14 July 2007

Discussion for jMaki Table Data Model

Line: 51 to 51
  ]
Changed:
<
<
This way you don't need to know the order of the data to get it to associate with the correct column.
>
>
This you can provide the column names as a property of the args or you can combine the columns and rows into a single object and pass it to the widget as a service or the value. The rows need to be provided as the value or via a service. For example:

{
  columns : [
   {id : 'company', 'label' : 'Company'}, 
   {id : 'price', 'label' : 'Price'}, 
   {id : 'change', 'label' : 'Change', 
   {id : 'pchange', 'label' : '% Change'}, 
   {id : 'lupdate', 'label' : 'Last Updated'}
  ], 
  rows : [
   {'company' : 'A Co',
      'price' : 71.72,
      'change' : 0.02,
      'pchange' : 0.03,
      'lupdate' : '9/1 12:00am'
     },
     {'company' : 'B Inc',
      'price' : 29.01,
      'change' : 0.42,
      'pchange' : 1.47,
      'lupdate' : '9/1 12:00am'
     }, 
     {'company' : 'C Group Inc',
      'price' : 83.81,
      'change' : 0.28,
      'pchange' : 0.34,
      'lupdate' : '9/1 12:00am'
     }, 
     {'company' : 'D Company',
      'price' : 52.55,
      'change' : 0.01,
      'pchange' : 0.02,
      'lupdate' : '9/1 12:00am'
     }                              
   ]
}
 

Ext and Yahoo Data Table Renderers

Line: 82 to 121
 
  • addRow - The payload value passed to the widget is added to the end of the table.
Changed:
<
<
jmaki.publish("/yahoo/dataTable/addRow", { data : [ {}, {}])
>
>
jmaki.publish("/yahoo/dataTable/addRow", { index : 1, data : {'company' : 'A Co', 'price' : 71.72, 'change' : 0.02, 'pchange' : 0.03, 'lupdate' : '9/1 12:00am' });
 
Changed:
<
<
  • insertRow - Insert the row which is the value of the payload at the index specified. Example :
>
>
  • addRows - The payload value passed to the widget is added to the end of the table.
 
Changed:
<
<
jmaki.publish("/yahoo/dataTable/insertRow", { index : 1, data : [ {}, {}])
>
>
jmaki.publish("/yahoo/dataTable/addRows", { index : 1, data : [ {'company' : 'A Co', 'price' : 71.72, 'change' : 0.02, 'pchange' : 0.03, 'lupdate' : '9/1 12:00am' }, {'company' : 'B Inc', 'price' : 29.01, 'change' : 0.42, 'pchange' : 1.47, 'lupdate' : '9/1 12:00am' }]);
 
  • removeRow
Added:
>
>
jmaki.publish("/yahoo/dataTable/addRow", { index : 0 });
* clear - Clears all rows
jmaki.publish("/yahoo/dataTable/clear", { });

TBD Subscribe Events

  • insertRow - (not yet implemented)
 

Publish Events

  • onSelect

 <<O>>  Difference Topic JMakiTableDataModel (11 - 14 Jul 2007 - Main.gmurray71)
Line: 1 to 1
Changed:
<
<
-- Main.gmurray - 09 July 2007
>
>
-- Main.gmurray - 14 July 2007
 

Discussion for jMaki Table Data Model

Changed:
<
<
Example of the data model for release .9

Using Array of Values for Rows

The most common and easy case for data tables is to provide a set of column names and the data as an array of arrays where the order of the data in each row determines which column the data appears in.

{
   'columns' :[
        {'title' : 'Company'}, 
        {'title' : 'Price',}, 
        {'title' : 'Change'}, 
        {'title' : '% Change'}, 
        {'title' : 'Last Updated'}
        ],
       rows : [
        ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
        ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
        ['Altria Group Inc',83.81,0.28,0.34,'9/1 12:00am']
    ]
}

Alternatively the column names can be passed in as part of the args and the value used as the rows so the following will also be true:

args set to :

{
     columns :[
        {title : 'Company'},
        {title : 'Price'},
        {title : 'Change'},
        {title : '% Change'},
        {title : 'Last Updated'}
     ]}

and the value set to:

[
        ['A Co',71.72,0.02,0.03,'9/1 12:00am'],
        ['B Inc',29.01,0.42,1.47,'9/1 12:00am'],
        ['C Group Inc',83.81,0.28,0.34,'9/1 12:00am'],
        ['D Company',52.55,0.01,0.02,'9/1 12:00am']
  ]
>
>
Example of the data model for release .9.5
 

Using Array of objects as Rows

Changed:
<
<
You can also use an array of objects that are keyed to the column names:
>
>
The rows should be an array of objects that are keyed to the column names:
 
 columns :[
Changed:
<
<
{id : 'company', title : 'Company'}, {id : 'price', title : 'Price', renderer: 'usMoney'}, {id : 'change', title : 'Change', renderer: 'change'}, {id : 'pchange', title : '% Change', renderer: 'pctChange'}, {id : 'lupdate', title : 'Last Updated', renderer: 'italic'
>
>
{id : 'company', 'label' : 'Company'}, {id : 'price', 'label' : 'Price'}, {id : 'change', 'label' : 'Change', {id : 'pchange', 'label' : '% Change'}, {id : 'lupdate', 'label' : 'Last Updated'}
 ]
Line: 107 to 60
 
{
     columns :[
Changed:
<
<
{title : 'Company'}, {title : 'Price', renderer: 'usMoney'}, {title : 'Change', renderer: 'change'}, {title : '% Change', renderer: 'pctChange'}, {title : 'Last Updated',renderer: 'italic'}
>
>
{'id' : 'company', 'label' : 'Company'}, {'id' : 'price', 'label' : 'Price', renderer: 'usMoney'}, {'id' : 'change', 'label' : 'Change', renderer: 'change'}, {'id' : 'pchange', 'label' : '% Change', renderer: 'pctChange'}, {'id' : 'lupdate', 'label' : 'Last Updated',renderer: 'italic'}
  ]}

 <<O>>  Difference Topic JMakiTableDataModel (10 - 10 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 09 July 2007

Discussion for jMaki Table Data Model

Example of the data model for release .9

Added:
>
>

Using Array of Values for Rows

The most common and easy case for data tables is to provide a set of column names and the data as an array of arrays where the order of the data in each row determines which column the data appears in.

 
{
   'columns' :[
Line: 46 to 52
  ]
Changed:
<
<
Alternatively you can use an array of objects that are keyed to the column names:
>
>

Using Array of objects as Rows

You can also use an array of objects that are keyed to the column names:

 
 columns :[

 <<O>>  Difference Topic JMakiTableDataModel (9 - 10 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 09 July 2007

Discussion for jMaki Table Data Model

Line: 61 to 61
 The column names need a unique id which is then used in the data to associate it with a given row. The rows would be defined as an array of objects where the property names match the ids given for any given column id.
Added:
>
>
[
  {'company' : 'A Co', 'price' : 71.72, 'change' : 0.02,

 <<O>>  Difference Topic JMakiTableDataModel (8 - 10 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 09 July 2007

Discussion for jMaki Table Data Model

Line: 54 to 54
  {id : 'price', title : 'Price', renderer: 'usMoney'}, {id : 'change', title : 'Change', renderer: 'change'}, {id : 'pchange', title : '% Change', renderer: 'pctChange'},
Changed:
<
<
{id : 'lupdate', title : 'Last Updated', renderer: 'italic'}
>
>
{id : 'lupdate', title : 'Last Updated', renderer: 'italic'
  ]

 <<O>>  Difference Topic JMakiTableDataModel (7 - 10 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 09 July 2007

Discussion for jMaki Table Data Model

Line: 46 to 46
  ]
Added:
>
>
Alternatively you can use an array of objects that are keyed to the column names:

 columns :[
                              {id : 'company', title : 'Company'}, 
                              {id : 'price', title : 'Price', renderer: 'usMoney'}, 
                              {id : 'change', title : 'Change', renderer: 'change'}, 
                              {id : 'pchange', title : '% Change', renderer: 'pctChange'}, 
                              {id : 'lupdate', title : 'Last Updated', renderer: 'italic'}
                              ]

The column names need a unique id which is then used in the data to associate it with a given row. The rows would be defined as an array of objects where the property names match the ids given for any given column id.

                               {'company' : 'A Co',
                                'price' : 71.72,
                                'change' : 0.02,
                                'pchange' : 0.03,
                                'lupdate' : '9/1 12:00am'
                               },
                               {'company' : 'B Inc',
                                'price' : 29.01,
                                'change' : 0.42,
                                'pchange' : 1.47,
                                'lupdate' : '9/1 12:00am'
                               }, 
                               {'company' : 'C Group Inc',
                                'price' : 83.81,
                                'change' : 0.28,
                                'pchange' : 0.34,
                                'lupdate' : '9/1 12:00am'
                               }, 
                               {'company' : 'D Company',
                                'price' : 52.55,
                                'change' : 0.01,
                                'pchange' : 0.02,
                                'lupdate' : '9/1 12:00am'
                               }                              
                              ]

This way you don't need to know the order of the data to get it to associate with the correct column.

Ext and Yahoo Data Table Renderers

 The Yahoo dataTable and the Ext Grid provide additional specialization on the core table model which allow for editors and renderers to be added on the individual columns.

 <<O>>  Difference Topic JMakiTableDataModel (6 - 10 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 09 July 2007

Discussion for jMaki Table Data Model

Line: 69 to 69
 

Subscribe Events

Changed:
<
<
  • addRow - The payload value passed to the widget is added to the table.
>
>
Subscribe events allow you to manipulate a given instance of a widget. The event names are appended to the the subscribe topic name following a "/". For example "addRow" for a yahoo.dataTable would be "/yahoo/dataTable/addRow"

  • addRow - The payload value passed to the widget is added to the end of the table.
 jmaki.publish("/yahoo/dataTable/addRow", { data : [ {}, {}])
 
  • insertRow - Insert the row which is the value of the payload at the index specified. Example :
 jmaki.publish("/yahoo/dataTable/insertRow", { index : 1, data : [ {}, {}])
Added:
>
>
  • removeRow
 

Publish Events

  • onSelect

 <<O>>  Difference Topic JMakiTableDataModel (5 - 10 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 09 July 2007

Discussion for jMaki Table Data Model

Line: 63 to 63
 

Row Events

Added:
>
>
Note these events are still under development and are not all available as of the .9.4 release. We plan to add these soon
 Rows events are published to the topic assigned to the given widget instance. Table events include:
Added:
>
>

Subscribe Events

  • addRow - The payload value passed to the widget is added to the table.
  • insertRow - Insert the row which is the value of the payload at the index specified. Example :
 jmaki.publish("/yahoo/dataTable/insertRow", { index : 1, data : [ {}, {}])

Publish Events

 
  • onSelect
Deleted:
<
<
  • addRow
 
  • onUpdate

 <<O>>  Difference Topic JMakiTableDataModel (4 - 10 Jul 2007 - Main.gmurray71)
Line: 1 to 1
 -- Main.gmurray - 09 July 2007

Discussion for jMaki Table Data Model

Line: 65 to 65
 Rows events are published to the topic assigned to the given widget instance. Table events include:
Added:
>
>
  • onSelect
  • addRow
  • onUpdate

 <<O>>  Difference Topic JMakiTableDataModel (3 - 10 Jul 2007 - Main.gmurray71)
Line: 1 to 1
Changed:
<
<
-- Main.carlavmott - 08 Jun 2007
>
>
-- Main.gmurray - 09 July 2007
 

Discussion for jMaki Table Data Model

Example of the data model for release .9

Line: 61 to 61
 Renderers and Editors are provided as public functions in the widgets.
Added:
>
>

Row Events

Rows events are published to the topic assigned to the given widget instance. Table events include:


 <<O>>  Difference Topic JMakiTableDataModel (2 - 22 Jun 2007 - Main.gmurray71)
Line: 1 to 1
Deleted:
<
<
 -- Main.carlavmott - 08 Jun 2007

Discussion for jMaki Table Data Model

Line: 8 to 6
 
{
   'columns' :[
Changed:
<
<
{'title' : 'Company', 'width' : 200, locked:false}, {'title' : 'Price', 'width' : 75, 'renderer': 'usMoney'}, {'title' : 'Change', 'width' : 75, 'renderer': 'change'}, {'title' : '% Change', 'width' : 75, 'renderer': 'pctChange'}, {'title' : 'Last Updated', 'width' : 85, 'renderer': 'italic'}
>
>
{'title' : 'Company'}, {'title' : 'Price',}, {'title' : 'Change'}, {'title' : '% Change'}, {'title' : 'Last Updated'}
  ], rows : [ ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
Line: 22 to 20
 }
Added:
>
>
Alternatively the column names can be passed in as part of the args and the value used as the rows so the following will also be true:

args set to :

{
     columns :[
        {title : 'Company'},
        {title : 'Price'},
        {title : 'Change'},
        {title : '% Change'},
        {title : 'Last Updated'}
     ]}

and the value set to:

[
        ['A Co',71.72,0.02,0.03,'9/1 12:00am'],
        ['B Inc',29.01,0.42,1.47,'9/1 12:00am'],
        ['C Group Inc',83.81,0.28,0.34,'9/1 12:00am'],
        ['D Company',52.55,0.01,0.02,'9/1 12:00am']
  ]

The Yahoo dataTable and the Ext Grid provide additional specialization on the core table model which allow for editors and renderers to be added on the individual columns.

{
     columns :[
        {title : 'Company'},
        {title : 'Price', renderer: 'usMoney'},
        {title : 'Change', renderer: 'change'},
        {title : '% Change', renderer: 'pctChange'},
        {title : 'Last Updated',renderer: 'italic'}
     ]}

Renderers and Editors are provided as public functions in the widgets.


 <<O>>  Difference Topic JMakiTableDataModel (1 - 08 Jun 2007 - Main.carlavmott)
Line: 1 to 1
Added:
>
>

-- Main.carlavmott - 08 Jun 2007

Discussion for jMaki Table Data Model

Example of the data model for release .9

{
   'columns' :[
        {'title' : 'Company', 'width' : 200, locked:false}, 
        {'title' : 'Price', 'width' : 75, 'renderer': 'usMoney'}, 
        {'title' : 'Change', 'width' : 75, 'renderer': 'change'}, 
        {'title' : '% Change', 'width' : 75, 'renderer': 'pctChange'}, 
        {'title' : 'Last Updated', 'width' : 85, 'renderer': 'italic'}
        ],
       rows : [
        ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
        ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
        ['Altria Group Inc',83.81,0.28,0.34,'9/1 12:00am']
    ]
}

Topic JMakiTableDataModel . { View | Diffs r49 < r48 < r47 < r46 | More }
 XML java.net RSS