aurelia-ui-toolkits / aurelia-kendoui-bridge

MIT License
117 stars 31 forks source link

Aurelia CLI - TypeScript - aurelia-kendoui-bridge Grid Editor Template (Error) #777

Closed arman-m closed 6 years ago

arman-m commented 6 years ago

I have a project with Aurelia CLI, TypeScript and Kendo UI Bridge. Most everything is working fine but recently I needed to place a DropDownList editor template in a Kendo UI Grid. I followed the sample code with almost no modifications but I'm getting an error when I click on any Category cell: app.ts:27 Uncaught TypeError: $(...).appendTo(...).kendoDropDownList is not a function at EditingCustomEditor.categoryDropDownEditor (http://localhost:9000/scripts/app-bundle.js:27:18)

The steps:

adriatic commented 6 years ago

@arman-m - it's too late here to dive into this now (11:36 PM), so let me start with the question:

Are you aware of this sample, which is relatively new and created with the intent to be used as the sample for this chapter (its a first draft of the document that will be published in the context of the AUCS project

arman-m commented 6 years ago

Hi @adriatic , Thank you for your response. I have the project running (almost finished with the functionality). Everything works fine except this strange issue where I can't seem to find a way to make the Kendo UI Grid display a dropdownlist as an editor with the setup I already have. The problem seems to be in the way packages are included because I put the exact same code in the sample that you suggested and it works. The difference is I followed the instructions and installed kendo with yarn (just ran yarn in the project folder). Another difference is that you include kendo libraries in the typescript modules while I have them included in the index.html. I would still like to understand why my version is not working. The exact same code (I pasted the bundled js content in the Gist sample) works in Gist. The only difference is that the Gist is using system.js instead of aurelia bootstrapper. I'm not sure why would that make any difference but...

adriatic commented 6 years ago

I am not in the position to look at your code to point out the difference between the sample that runs in the gist-run. However, your comment about using Bootstraper instead of system.js makes me worry that you may not have the correct understanding of the Aurelia CLI tooling. System.js is one of the popular module loaders that is not being used in CLI generated code (it’s Require.js that plays the role of the Module loader). Bootstrapped is a component of the Aurelia framework that is always used, regardless of the choice of the Module loader.

The context of the gist could quite different from your own app (it uses the system.js loader), so you cannot mix and match parts of the tooling.

arman-m commented 6 years ago

Thanks @adriatic. I guess if I were the expert I wouldn't be here annoying you with questions. I'm new to node stack and all of this is still blurry to me. I figured it out though. It turned out that jquery was the issue. It was included twice - once in the aurelia.json and the second time via the script tag in index.html. Maybe this information would be useful to someone like me searching for a solution.

adriatic commented 6 years ago

This is a good example of rubber ducking, @arman-m 😄

While you could easily conclude that the answer to your question would be quite difficult to derive ffrom your problem description, I caught on the one thing I could see as wrong. In no way was this meant to indicate my annoyance with you. I am quite impressed that you did find the answer yourself.