Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

How to use observable path in a for cycle #133

Closed
mommy75 opened this Issue · 4 comments

2 participants

@mommy75

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.

@BorisMoore
Owner

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

@BorisMoore
Owner

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

@BorisMoore
Owner

@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...

@BorisMoore
Owner

I assume this is covered. Closing...

@BorisMoore BorisMoore closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.