Comments (3)
@AndyCJ - are you seeing a specific problem with lazy loading templates? That is generally how I have used knockout-amd-helpers
(at least for a dev build). When the template content becomes available, then the template/module binding is re-evaluated. I may be misunderstanding your comment/issue, but I am happy to help you sort it out. Thanks!
from knockout-amd-helpers.
@rniemeyer I was using some third party code that makes a direct call to renderTemplateSource
, so there's no template binding.
This is no longer an issue for me as I've move on to using a different approach.
from knockout-amd-helpers.
@rniemeyer @AndyCJ Hi there,
I am facing an issue which is pretty similar to what is mentioned in the above issue.
My code internally calls renderTemplateSource and the text function returns an empty string (templateText) in the code below. Since require is fetching the file asynchronously.
var templateText = templateSource['text']();
This empty text is then returned to be appended to the template HTML which I am trying to load, which looks something like this
<script type="text/html" id="EDIT_CELL_TEMPLATE"> <div data-bind=" attr: { style: $parent.cellStyle($cellContext, ''), css: $parent.cellClass($cellContext), }, template: { data: $parent.inlineEditViewModel, name: $parent.getModuleInfo().viewName }"> </div> </script>
The above template resolves into an input component.
Although the UI loads up perfectly, the JET internal code is trying to render the above script and focus on the input component which the template resolves to. But since the function renderTemplateSource returns empty text while trying to resolve the above templates nodes, the HTML does not contain any focusable element and is left with only the non-focusable elements in the script above. This prevents the JET component from getting into a certain edit mode which causes undesired behaviour.
Is there any way we could work around this issue?
Any help would be deeply appreciated.
Thanks
from knockout-amd-helpers.
Related Issues (20)
- AfterRender not firing when module is initialized with a null observable HOT 2
- Getting the reference to the bound element HOT 10
- module and template loaders don't work with require.config moduleIDs packages HOT 12
- API available in bonded module needs to be called after template finishes rendering HOT 2
- Working with Typescript AMD Modules HOT 2
- [Request] Option to require additional files by convention HOT 1
- Provide simple way to load external templates from within custom bindings HOT 1
- afterRender still fires only for the first template when using external templates with requirejs/text HOT 2
- publish NuGet package for v.0.7.3 HOT 1
- Module Binding: require() for the template source should not have to wait until the module is downloaded
- Passing data from Tempate to Module HOT 2
- template binding with 'with' doesn't work HOT 4
- beforeRemove callback is not firing for template binding HOT 5
- Ready to use KO module using requirejs "map" HOT 2
- Passing markup into modules HOT 14
- Knockout-amd-helpers does not play well with r.js namespacing HOT 3
- Dynamically assigning a template path in renderTemplate() HOT 2
- not working with webpack very well. HOT 2
- knockout-amd-helpers need new typings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knockout-amd-helpers.