Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getIOCfg() {
- var cfg = {
- method: 'POST',
- data: "feed_id="+feedId,
- form: {
- id: "#myform",
- useDisabled: true,
- upload: false,
- },
- on: {
- failure: function(e) {
- alert("Boom from IO!");
- }
- }
- };
- return cfg;
- }
- // rebuilds columns data
- var columns = Array();
- var dataSourceFields = Array();
- Y.all(myconfig.s.activeFields).each(function (node) {
- customFieldName = node.one(myconfig.s.customFieldName).get("value")
- columns.push({ key : customFieldName });
- dataSourceFields.push(customFieldName);
- });
- // DataSource
- var selectProductsDS = new Y.DataSource.IO({
- source: myconfig.preiewURL
- });
- selectProductsDS.plug(Y.Plugin.DataSourceJSONSchema, {
- schema: {
- resultFields: dataSourceFields,
- }
- });
- selectProductsDS.after("response", function () {
- selectProductsTable.render(target);
- selectProductsDS.detachAll("response");
- });
- // DataTable
- var selectProductsTable = new Y.DataTable.Base({
- columnset: columns,
- });
- selectProductsTable.plug(Y.Plugin.DataTableDataSource, {
- datasource: selectProductsDS
- });
- Y.one(target).setContent("");
- selectProductsTable.datasource.load({
- cfg : getIOCfg(EditFeedConfig.previewFormat),
- /*
- callback : {
- failure: function (o) {
- alert("Boom from DS!")
- }
- }
- */
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement