Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree Item not expanding.. #3

Open
planctron opened this issue Oct 21, 2021 · 6 comments
Open

Tree Item not expanding.. #3

planctron opened this issue Oct 21, 2021 · 6 comments
Assignees

Comments

@planctron
Copy link

planctron commented Oct 21, 2021

Having four (demo) categories in my list, but see only "All" tree node which cannot be expanded.

Cause: I could find that the "toggleChildren" looks different than in web tutorial.
toggleChildren() {
if (
this.props.item.child_id.length > 0 &&
this.props.item.children == undefined
) {
this.trigger("tree_item_clicked", { data: this.props.item });
}
Object.assign(this.state, {
childrenVisible: !this.state.childrenVisible,
});
}
}

@PhilDL PhilDL self-assigned this Oct 21, 2021
@PhilDL
Copy link
Member

PhilDL commented Oct 21, 2021

Hi @planctron, do you have any error message on the Console ? What is the OS and Browser used here ?

Yes the code is different from the Tutorial, depending on what step you are. The main branch follow the part 3 of the Tutorial where there is a refactor of the code. The end code is

toggleChildren() {
        if (this.props.item.child_id.length > 0) {
          this.trigger("tree_item_clicked", { data: this.props.item });
        }
      }

In this version, the Controller is listening to the "tree_item_clicked" event, and call the Model. The Model itself will then check if children are undefined to know if it should do an RPC Call or not.

If you update your source code to the main branch here, is there still problems ?

@planctron
Copy link
Author

planctron commented Oct 22, 2021

I used the main branch. This toggleChildren() just does not work (for me?).
If I add the "Object.assign(...", I can get the expected result.

@PhilDL
Copy link
Member

PhilDL commented Oct 25, 2021

Hello @planctron, is this issue with the same setup as the other one, ie OWL 1.2.3 ?

Because on OWL 1.2.3 I also cannot get it to work, but it is fixed on any OWL >= 1.2.4.

@Fritzlseppl
Copy link

Hi.
I am on owl 1.2.6 and i have the problem that the props does not have an item node. i must admit that i did not do the tutorial, i am trying something else. but this seemed the only place where someone could know the issue. Does someone know how to get information of the widget, through to the component? thanks

@PhilDL
Copy link
Member

PhilDL commented Nov 11, 2021

@Fritzlseppl Hi, if you are doing something else please give me a link to your repo so i could investigate.

@Fritzlseppl
Copy link

@PhilDL I unfortunately can not share the whole addon, but most of it is not related to what i mentioned anyways. What i am trying to do is the following: I made a custom purchase module from scratch and the orders within must be confirmed. therefor an email is sent to the person responsible to do this. the emails show up in the chatter section below the order in the form view, but i dont want that. i thought the best way to do that would be to give an option in the message_ids field which defines the chatter. ive got so far as that i can pass the option to the root component below the form_renderer widget, which forms the chatter section. but i struggle to pass the option down to the message_list holding the single messages. if i could access the option there i extended its template and added an t-if, to not show the messages which have message_type "email" if the option is given. so the only thing i needed is how to pass a param through the components or how to access a value of the xml field from an underlying component. maybe i have to use the store for this?
Thanks in advance for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants