Coder Social home page Coder Social logo

Comments (6)

NorCalm avatar NorCalm commented on May 19, 2024

By no means am I an expert - I just started learning Javascript and found Meteor/Webix crazy-easy to learn.

But how I've been pulling in a JSON file is to use the mongoimport program so that it becomes a Meteor collection (so you can use url property to load and save property to save), e.g.

webix.ui({
view: 'datatable',
autoconfig: true,
editable: true,
url: webix.proxy('meteor', Emails.find()),
save: webix.proxy('meteor', Emails)
});

I'm sure there's other ways to do this, but my JSON file is coming via ODBC so I already have to automate via a shell script anyway.

from meteor-webix.

KyleKing avatar KyleKing commented on May 19, 2024

Thanks for responding! Yeah, I'm using the same technique to proxy the MondoDB data, which is really awesomely built; however, I'm having trouble with editing an object field using Webix's API.

So if you had a document like this:

{
  "name": "John",
  "stuff": ["part 1", "part 2", "part 3"],
  "moreStuff": {
    "phone": {
      "brand": "iphone",
      "version": 6,
      "valid": false
    }
  }
}

I can only display the field, "brand," but can't update it natively. With the code below, it creates a new field with the name brand (or whatever string is in the id field) rather than using the specific property created with the map setting.

{
  "name": "John",
  "stuff": ["part 1", "part 2", "part 3"],
  "moreStuff": {
    "phone": {
      "brand": "iphone",
      "version": 6,
      "valid": false
    }
  },
  "brand": "editedContent"
}
var dataTable;

dataTable = {
  view: 'datatable',
  id: 'datatable',
  columns: [
    {
      id: 'someText',
      header: 'This is a brand',
      editor: 'text',
      fillspace: true,
      map: "#moreStuff.phone.brand#"
    }
  ],
  select: true,
  editable: true,
  editaction: 'dblclick',
  url: webix.proxy('meteor', Meteor.users),
  save: webix.proxy('meteor', Meteor.users)
};

// ---
// generated by coffee-script 1.9.2

Are you having the same issues? How would you display and edit the field "brand"?

from meteor-webix.

KyleKing avatar KyleKing commented on May 19, 2024

If you're interested, I created a working example at: https://github.com/KyleKing/meteor-webix/tree/master/examples/crud-objects

Update: I've tried using the scheme setting, but Webix continues to fall back on the id property to update a document (relevant documentation: http://docs.webix.com/datatable__data_mapping.html)

from meteor-webix.

NorCalm avatar NorCalm commented on May 19, 2024

@KyleKing I haven't had time to look at this, but I would suggest the use of Webix Snippet (http://webix.com/snippet/) to work through Webix issues. It doesn't sound like it is much to do with Meteor yet so if you get your working example up on Snippet I think more folks (including me when I get a chance) will be able to interactively play with this.

Generally all of my datatable JSON objects are simple 2-d rows/columns without hierarchy.

from meteor-webix.

KyleKing avatar KyleKing commented on May 19, 2024

Thanks for the suggestion! And whenever you have a chance, I started a snippet here: http://webix.com/snippet/9a29f390. I'm not sure how to save/load the data in a snippet, but I created a variable and display it on the table

from meteor-webix.

KyleKing avatar KyleKing commented on May 19, 2024

I'm switching to meteor-tabular, since it has the functions that I'm looking for.

If anyone else has the same issue, I found an older issue that looks like it should help fix this: #5

from meteor-webix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.