How to use observable path in a for cycle #133

Closed
mommy75 opened this Issue Dec 19, 2012 · 4 comments

Comments

Projects
None yet
2 participants

mommy75 commented Dec 19, 2012

Hi Boris!
I use the jsrender e jsviews libraries to rendering the reports.

I use the $.observable(report).setProperty(newReport) to view the changes in the inner structure.

My report object is a complex structure, something like that:

var report = {
  reportProvider: {
    description: "Report description",
    displayName: "Report name",
    id: "123456789",
    rows: [
      {
        rowIdx: 0,
        visible: true,
        cells: [
          {
            colIdx: 0,
            idVal: "HELEMENT_ID",
            viewVal: "ELEMENT_ID",
            type: "H",
            subType: "He"
          },
          {
            colIdx: 1,
            idVal: "HELEMENT_NAME",
            viewVal: "ELEMENT_NAME",
            type: "H",
            subType: "He"
          },
          {
            colIdx: 2,
            idVal: "HELEMENT_TYPE",
            viewVal: "ELEMENT_TYPE",
            type: "H",
            subType: "He"
          }
        ]
      },
      {
        rowIdx: 1,
        visible: true,
        cells: [
          {
            colIdx: 0,
            idVal: "1",
            viewVal: "135355140284392",
            type: "R",
            subType: "D"
          },
          {
            colIdx: 1,
            idVal: "135355140284392",
            viewVal: "a",
            type: "R",
            subType: "D"
          },
          {
            colIdx: 2,
            idVal: "a",
            viewVal: "1004",
            type: "R",
            subType: "D"
          }
        ]
      }
    ]
  }
};

How can I combine the instruction {{for cells}}...{{/for}} and the syntax "^" in the "data-link" attribute?
I don't know how to data-linking the cells in the for cycle.
For example, if the viewVal property of the 2nd cell of the 2nd row changes, how can I observe this change?

Thanks.

Owner

BorisMoore commented Jan 8, 2013

Sorry not to reply yet. I will do so after I have got the upcoming major update committed...

Owner

BorisMoore commented Feb 22, 2013

See comment in #83 on the upcoming {^{for ...}} binding.
I'll try to add a comment here too after that update is submitted.

Owner

BorisMoore commented Oct 8, 2013

@mommy75 : See the documentation here: http://www.jsviews.com/#samples/data-link/for-and-if, and the whole tutorial sequence: http://www.jsviews.com/#samples/data-link

Does that answer your scenario? If so, we can close this issue...

Owner

BorisMoore commented Nov 29, 2013

I assume this is covered. Closing...

BorisMoore closed this Nov 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment