 |
| | Main Model page
jMaki Table Data Model | | | object :: = "object :" ""
| |
< < | | > > | 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: |
| | Main Model page
jMaki Table Data Model | | | Subscribe Events
| event type | argument (object literal) |
| |
< < |
| addRow | { value: <row>}] |
| addRows | { value: <rows>]} |
| > > |
| addRow | { value: <row>} |
| addRows | { value: [<row>]} |
| | |
| clear | {} |
| removeRow | {targetId : < rowId>} |
| select | {targetId : < rowId>} |
| |
> > |
| 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" | | | ]
});
| |
> > |
jmaki.publish("/yahoo/dataTable/clear", { });
| | |
jmaki.publish("/yahoo/dataTable/removeRow", { targetId : 'foo'}); | | | The rowId should be the id of the row you wish to remove. | |
< < | * clear - Clears all rows | > > |
- updateRow - Updates the row with the given rowId with the data provided.
| | | | |
< < | 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 | | |
| Event type | Payload | Event |
| onSelect | {widgetId : uuid , topic : , type : 'onSelect' , targetId : selected_row} | Publshed when a user selects a row. |
| |
< < | (1.3) Ext and Yahoo Data Table Extensions | > > | (1.3) Yahoo Data Table Extensions
TBD in jMaki 1.1 | | |
Last Modified: | |
< < | -- Main.gmurray - 1 Aug 2007 | > > | -- Main.gmurray - 27 Sept 2007 | | | |
| | Main Model page
jMaki Table Data Model | | |
| addRow | { value: <row>}] |
| addRows | { value: <rows>]} |
| clear | {} |
| |
< < |
| 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" | | | These are the events published to the "publish" topic associated with a widget.
| |
< < |
| 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: | |
< < | -- Main.gmurray - 22 July 2007 | > > | -- Main.gmurray - 1 Aug 2007 | | | |
| | Main Model page
jMaki Table Data Model | | | | |
< < | 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. |
| | Main Model page
jMaki Table Data Model | | |
{
columns : [ | |
< < | {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', |
| | Main Model page
jMaki Table Data Model | | | rows :: = "[" {} "]"
row ::= "{" [< rowId >] , ": " [ | | |
< < | object :: = "object :" " | > > | object :: = "object :" "" | | | | | | These are the events published to the "publish" topic associated with a widget. | |
< < | | 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 |
| | Main Model page
jMaki Table Data Model | | | column ::= "{ label :" " "id :" "},"
columnid :: = ,
rows :: = "[" {} "]" | |
< < | row ::= "{" [< rowId >] , ": " "}", | > > | row ::= "{" [< rowId >] , ": " [ | | | | rowId :: = "rowId :" "" | |
> > | object :: = "object :" " | | | |
| | Main Model page
jMaki Table Data Model | | | { title : 'Book Title 3',
author : 'Author 3',
isbn: '4415', | |
< < | description : 'A Some long description'}, | > > | description : 'A Some long description'
}, | | | { title : 'Book Title 4',
author : 'Author 4',
isbn: '4416', | |
< < | description : 'A Some long description'} | > > | description : 'A Some long description'
} | | | ]
});
|
| | Main Model page
jMaki Table Data Model | | | {id : 'lupdate', label : 'Last Updated'}
],
rows : [ | |
< < | { 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' | | | }, | |
< < | {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'} | | | ]
}
| | |
- addRow - The payload value passed to the widget is added to the end of the table.
| |
< < | 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.
| |
< < | 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'}
]
}); | | | | | | 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:
jmaki.publish("/yahoo/dataTable/addRows", {value : [
{ title : 'Book Z',
author : 'Author Z',
isbn: '4414',
description : 'A Some long description'
}
]
});
| | | * clear - Clears all rows |
|
< < | -- Main.gmurray - 14 July 2007 | | | Main Model page
jMaki Table Data Model | | | column ::= "{ label :" " "id :" "},"
columnid :: = ,
rows :: = "[" {} "]" | |
< < | row ::= "{" [] , ": " "}",
rowid :: = "id :" "" | > > | row ::= "{" [< rowId >] , ": " "}",
rowId :: = "rowId :" "" | | | | | | Subscribe Events
| event type | argument (object literal) |
| |
< < |
| addRow | { data: <row>, [<index>}] |
| addRows | { data: <rows> , [<index>]} |
| > > |
| addRow | { value: <row>}] |
| addRows | { value: <rows>]} |
| | |
| |
< < |
| 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.
| |
< < | 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, | | | }});
| |
< < |
- 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.
| | | | |
< < | 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, | | | | |
< < | jmaki.publish("/yahoo/dataTable/removeRow", { index : 'foo'}); | > > | jmaki.publish("/yahoo/dataTable/removeRow", { rowId : 'foo'}); | | | | |
< < | 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: | |
< < | jmaki.publish("/yahoo/dataTable/addRows", {index : 1, data: [ | > > | jmaki.publish("/yahoo/dataTable/addRows", {value : [ | | | { title : 'Book Z',
author : 'Author Z',
isbn: '4414', | | | Publish Events | |
< < |
| 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. | | | | |
< < | (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. |
| | | | |
< < | 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 | | | | |
< < |
{
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. | > > | Last Modified: | | | | |
< < | - | > > | -- Main.gmurray - 22 July 2007 | | | |
| | -- Main.gmurray - 14 July 2007 | |
> > | Main Model page | | | jMaki Table Data Model
| | | (1.2) Data Model | |
> > | tabledata ::= "{" [] "}" | | | columns ::= "[" {} "]" | |
< < | column ::= "{" label : "", id : "},"
columnid :: = "", | > > | column ::= "{ label :" " "id :" "},"
columnid :: = , | | | rows :: = "[" {} "]" | |
< < | row ::= "{" [] , : "" "}",
rowid :: = id : "" | > > | row ::= "{" [] , ": " "}",
rowid :: = "id :" "" | | | | | |
- addRow - The payload value passed to the widget is added to the end of the table.
| |
< < | 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' | |
< < | }); | > > | }}); | | |
- addRows - The payload value passed to the widget is added to the end of the table.
| | | change : 0.42,
pchange : 1.47,
lupdate : '9/1 12:00am' | |
< < | }]); | > > | }]} ); | | | | | |
| event type | payload |
| onSelect | {id : uuid , topic : , type : 'onSelect' , data : array of ids of selected rows} |
| |
< < |
| 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 |
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | |
- 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', | > > | jmaki.publish("/yahoo/dataTable/addRow", {company : 'A Co', | | | price : 71.72,
change : 0.02,
pchange : 0.03, |
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | |
| 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} |
| > > |
| onCellEdit | {id: uuid, column:columnid, row: rowid, value: value} |
| | | (1.3) Ext and Yahoo Data Table Extensions |
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | | {
columns : [
{id : 'company', label : 'Company'}, | |
< < | {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'}
], | | |
- 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', | |
< < |
-
- price'
- 71.72,
| > > | price : 71.72, | | | change : 0.02,
pchange : 0.03,
lupdate : '9/1 12:00am' |
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | |
{
columns : [ | |
< < | {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 : [ | |
< < | { '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' | | | }, | |
< < | {'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' | | | },
{ | |
< < | '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' | | | }, | |
< < | {'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' | | | }
]
} | | |
columns ::= "[" {<column>} "]" | |
< < | column ::= "{" "label : " , "id" : "},"
columnid :: = , | > > | column ::= "{" label : "", id : "},"
columnid :: = "", | | | rows :: = "[" {} "]" | |
< < | row ::= "{" [] , "" : "}",
rowid :: = "id : " | > > | row ::= "{" [] , : "" "}",
rowid :: = id : "" | | | | | |
- 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',
'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', | |
< < | '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' | | | }, | |
< < | {'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' | | | }]);
| | |
{
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'} | > > | {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'} | | | ]}
| | |
{
columns :[ | |
< < | {'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'} | | | ]
}
|
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | | Subscribe Events
| event type | argument (object literal) |
| |
< < |
| addRow | { data : <rows>, [<index>}] |
| addRows | { data : <row> , [<index>]} |
| > > |
| addRow | { data : <row>, [<index>}] |
| addRows | { data : <rows> , [<index>]} |
| | |
| clear | {} |
| removeRow | {index : <rowid>} |
|
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | | ]}
| |
< < | 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. | | |
{ |
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model
| |
< < | --+++ (1.1) Examples | | | Using Array of objects as Rows |
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | |
- addRow - The payload value passed to the widget is added to the end of the table.
| |
< < | 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, | | |
- addRows - The payload value passed to the widget is added to the end of the table.
| |
< < | 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, | | | 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", {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 | | | ]}
| |
< < | 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. | | | - |
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | | Subscribe Events
| event type | argument (object literal) |
| |
< < |
| addRow | {<rows>, [<index>}] |
| addRows | { <row> , [<index>]} |
| > > |
| addRow | { data : <rows>, [<index>}] |
| addRows | { data : <row> , [<index>]} |
| | |
| clear | {} |
| removeRow | {index : <rowid>} |
|
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | | Subscribe Events
| event type | argument (object literal) |
| |
< < |
| addRow | <rows>, [<index>] |
| addRows | <row> , [<index>] |
| clear | |
| removeRow | index : <rowid> |
| > > |
| addRow | {<rows>, [<index>}] |
| addRows | { <row> , [<index>]} |
| clear | {} |
| removeRow | {index : <rowid>} |
| | |
index :: = <rowid> | <number> |
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | | Subscribe Events | |
< < |
| > > |
| event type | argument (object literal) |
| | |
| addRow | <rows>, [<index>] |
| addRows | <row> , [<index>] |
| clear | |
|
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model
| |
< < | (1.1) Examples | > > | --+++ (1.1) Examples | | | Using Array of objects as Rows | | | Rows events are published to the topic assigned to the given widget instance. Table events include: | |
> > | Subscribe Events | | |
| event type | payload |
| addRow | <rows>, [<index>] |
| addRows | <row> , [<index>] |
| | |
index :: = <rowid> | <number>
| |
< < | 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" | | | 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 | | | Publish Events | |
< < |
- onSelect - Payload is {id : , topic : , type : 'onSelect' , data : }
You will need to assign ids to the given rows for you to detect select events.
| > > |
| 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} |
| | | | |
< < | (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. |
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | | Rows events are published to the topic assigned to the given widget instance. Table events include:
| |
< < |
| addRow | <rows>, [] |
| addRows | <row> , [] |
| > > |
| addRow | <rows>, [<index>] |
| addRows | <row> , [<index>] |
| | |
| clear | |
| removeRow | index : <rowid> |
|
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | |
| clear | |
| removeRow | index : <rowid> |
| |
> > | | | | 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" |
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | | Rows events are published to the topic assigned to the given widget instance. Table events include:
| |
< < |
| > > |
| addRow | <rows>, [] |
| addRows | <row> , [] |
| | |
| |
< < |
| removeRow | indexzx : <rowid> |
| > > |
| removeRow | index : <rowid> |
| | | | |
> > | 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" |
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | |
| event type | payload |
| addRow | <row> |
| clear | |
| |
< < |
| > > |
| removeRow | indexzx : <rowid> |
| | | Subscribe Events |
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | | Rows events are published to the topic assigned to the given widget instance. Table events include:
| |
< < |
| > > |
| | |
|
| | -- Main.gmurray - 14 July 2007
jMaki Table Data Model | | | Rows events are published to the topic assigned to the given widget instance. Table events include: | |
> > |
| event type | payload |
| addRow | |
| clear | |
| removeRow | rowid |
| | | Subscribe Events |
| | -- Main.gmurray - 14 July 2007 | |
< < | r jMaki Table Data Model | > > | jMaki Table Data Model | | | | | | rowid :: = "id : "
| |
< < | --+++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 | > > | (1.2) Events | | | Rows events are published to the topic assigned to the given widget instance. Table events include: |
| | -- Main.gmurray - 14 July 2007
r jMaki Table Data Model | |
< < | Example of the data model for release .9.5 | > > | | | | (1.1) Examples |
| | -- Main.gmurray - 14 July 2007
r jMaki Table Data Model | | | rowid :: = "id : "
| |
> > | --+++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 | | | 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: | > > | - | | | |
| | -- Main.gmurray - 14 July 2007
r jMaki Table Data Model | | | 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 | > > | (1.2) Data Model | | |
columns ::= "[" {<column>} "]" | | | rowid :: = "id : "
| |
< < | 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 | | | You will need to assign ids to the given rows for you to detect select events.
| |
> > | (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: | | | |
| | -- Main.gmurray - 14 July 2007
r jMaki Table Data Model | | | {id : 'lupdate', 'label' : 'Last Updated'}
],
rows : [ | |
< < | {'company' : 'A Co', | > > | { 'id' : 'r1',
'company' : 'A Co', | | | 'price' : 71.72,
'change' : 0.02,
'pchange' : 0.03,
'lupdate' : '9/1 12:00am'
}, | |
< < | {'company' : 'B Inc', | > > | {'id' : 'r2',
'company' : 'B Inc', | | | 'price' : 29.01,
'change' : 0.42,
'pchange' : 1.47,
'lupdate' : '9/1 12:00am'
}, | |
< < | {'company' : 'C Group Inc', | > > | {
'id' : 'r3',
'company' : 'C Group Inc', | | | 'price' : 83.81,
'change' : 0.28,
'pchange' : 0.34,
'lupdate' : '9/1 12:00am'
}, | |
< < | {'company' : 'D Company', | > > | {'id' : 'r4',
'company' : 'D Company', | | | 'price' : 52.55,
'change' : 0.01,
'pchange' : 0.02, | | | }
| |
< < | 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 |
| | -- Main.gmurray - 14 July 2007
r jMaki Table Data Model | | | Using Array of objects as Rows | |
< < | 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. | | |
{ | | | | |
> > | 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 |
| | -- Main.gmurray - 14 July 2007 | |
< < | Discussion for jMaki Table Data Model | > > | r jMaki Table Data Model | | | Example of the data model for release .9.5 | |
> > | (1.1) Examples | | | Using Array of objects as Rows | | | | |
> > | (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. |
| | -- Main.gmurray - 14 July 2007
Discussion for jMaki Table Data Model | | | | |
< < | jmaki.publish("/yahoo/dataTable/addRow", { index : 0 }); | > > | jmaki.publish("/yahoo/dataTable/removeRow", { index : 'foo'}); | | | | |
> > | 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", { });
| |
< < | TBD Subscribe Events | > > | Publish Events | | | | |
< < |
- insertRow - (not yet implemented)
| > > |
- onSelect - Payload is {id : , topic : , type : 'onSelect' , data : }
| | | | |
< < | Publish Events | > > | You will need to assign ids to the given rows for you to detect select events. | | | | |
< < | | | | |
| | -- Main.gmurray - 14 July 2007
Discussion for jMaki Table Data Model | | | ]
| |
< < | 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 | | |
- addRow - The payload value passed to the widget is added to the end of the table.
| |
< < | 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'
}); | | | | |
< < |
- 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.
| | | | |
< < | 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'
}]); | | | | |
> > |
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
|
|
< < | -- Main.gmurray - 09 July 2007 | > > | -- Main.gmurray - 14 July 2007 | | | Discussion for jMaki Table Data Model | |
< < | 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 | |
< < | 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 :[ | |
< < | {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'} | | | ]
| | |
{
columns :[ | |
< < | {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'} | | | ]}
|
| | -- Main.gmurray - 09 July 2007
Discussion for jMaki Table Data Model
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' :[ | | | ]
| |
< < | 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 :[ |
| | -- Main.gmurray - 09 July 2007
Discussion for jMaki Table Data Model | | | 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, |
| | -- Main.gmurray - 09 July 2007
Discussion for jMaki Table Data Model | | | {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 : 'lupdate', title : 'Last Updated', renderer: 'italic' | | | ]
|
| | -- Main.gmurray - 09 July 2007
Discussion for jMaki Table Data Model | | | ]
| |
> > | 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. |
| | -- Main.gmurray - 09 July 2007
Discussion for jMaki Table Data Model | | | Subscribe Events | |
< < |
- 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 : [ {}, {}])
| |
> > | | | | Publish Events
|
| | -- Main.gmurray - 09 July 2007
Discussion for jMaki Table Data Model | | | 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
- 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 | | | | |
< < | | | | |
| | -- Main.gmurray - 09 July 2007
Discussion for jMaki Table Data Model | | | Rows events are published to the topic assigned to the given widget instance. Table events include: | |
> > | |
|
< < | -- Main.carlavmott - 08 Jun 2007 | > > | -- Main.gmurray - 09 July 2007 | | | Discussion for jMaki Table Data Model
Example of the data model for release .9 | | | Renderers and Editors are provided as public functions in the widgets. | |
> > | Row Events
Rows events are published to the topic assigned to the given widget instance. Table events include: |
|
< < | | | | -- Main.carlavmott - 08 Jun 2007
Discussion for jMaki Table Data Model | | |
{
'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'} | > > | {'title' : 'Company'},
{'title' : 'Price',},
{'title' : 'Change'},
{'title' : '% Change'},
{'title' : 'Last Updated'} | | | ],
rows : [
['3m Co',71.72,0.02,0.03,'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']
]
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. |
|
> > |
-- 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']
]
}
|
|