Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var columnDescription =
- [
- {key:'Requirements'},
- {key:'abc'},
- {key:'xyz'}
- ];
- var dataSrcSample = new YAHOO.util.FunctionDataSource(getDataGrid);
- myDataSource.connMethodPost = true;
- myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
- myDataSource.responseSchema = {
- fields:['Requirements',
- {key:'abc',parser:YAHOO.util.DataSource.parseString},
- {key:'xyz',parser:YAHOO.util.DataSource.parseString}]
- };
- YAHOO.example.sampleTable = function()
- {
- var columnDesc=columnDescription;
- var myDataSource = dataSrcSample;
- var oConfigs =
- {
- width:'100%'
- };
- var myDataTable = new YAHOO.widget.DataTable("tableContainerDiv",
- columnDesc,
- myDataSource,
- oConfigs);
- }();
- function getDataGrid()
- {
- //calls backend and gets the data
- }
- function parseNull(value) {
- // This exact logic may be incorrect, depends on what you get for value in the null case
- if (value=='null') {
- return null;
- }
- YAHOO.util.DataSource.parseString(value);
- }
- {key:'abc',parser:parseNull}
Add Comment
Please, Sign In to add comment