Webix Jet - segmented bug

I have a Jet app with a few subviews, one of which has a segmented view, used as a filter.

When I define this segmented view inside the config function, all is fine, but when I define it at the class level, it gives an error after some usage (see below).

Working (coffeescript, event handlers left out):

import {JetView} from "webix-jet"

export default class StatusView extends JetView

  config: ->
    filter = 
      view: "segmented"
      value: "new"
      options: [
        {id: "new", value: "New"}
        {id: "in_progress", value: "In progress"}
        {id: "finished", value: "Finished"}
      ]
    rows: [filter]

Now when I define the filter outside the config function:

import {JetView} from "webix-jet"

export default class StatusView extends JetView

  filter = 
    view: "segmented"
    value: "new"
    options: [
      {id: "new", value: "New"}
      {id: "in_progress", value: "In progress"}
      {id: "finished", value: "Finished"}
    ]

  config: ->
    rows: [filter]

it seems to work fine, as long as I don't click on any of the segments, and then switch to another subview of my app. The bug occurs when I then switch back to the 'StatusView' page, it errors out with:

Cannot create property '_inner' on string 'in_progress'

The value of the 'string' in the error is whatever was selected last on the previous visit. I am unable to figure out how this is possible.

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion