Coder Social home page Coder Social logo

Comments (3)

rniemeyer avatar rniemeyer commented on September 3, 2024

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

 avatar commented on September 3, 2024

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

imtonyjoseph avatar imtonyjoseph commented on September 3, 2024

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.