Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6068517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:43:24+00:00 2026-05-23T09:43:24+00:00

I created a dojo widget for displaying a form data. I want to enable

  • 0

I created a dojo widget for displaying a form data. I want to enable inline editing in this widget. First I started experimenting by writing html as strings in JavaScript. I don’t want to do this. dojo provides an interface dojo.cache() to load html files as templates. Used this method to load the template data for form view.

For form edit. An ajax call will be sent and I will recieve the field type data. Based on this I have to parse the html to an inline editor.

My question is, How to use dojo.cache() and acquire the html based on the input type. The template might contain data like

<input type="text" />
or
<select></select>
or
<textarea></textarea>
or
<div class="autocomplete"></div>

or something more … Can I define all these templates in one file and get the file using dojo.cache() ? In this case I’m stuck at how to select the required field.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:43:25+00:00Added an answer on May 23, 2026 at 9:43 am

    I’m not sure how complex the templates that you would be bringing in via dojo.cache are, but have you considered using dojo.create() as an alternative? This will allow to programmatically create the DOM elements as well.

    In regards to your solution, I was confused at first at what you are trying to do but I think I get it now. Within the page that you are displaying the data, you want the user to be able to choose some data to edit and when they do that action, an appropriate editable container will show up in its place for them to change the data?

    If this is the case, I definitely dojo.create() is a better alternative to this than the HTML templates pulled in from dojo.cache.

    dojo.create could easily be used with variables that come back from your service XHR call so that the type of element that is created will be dependent on the response you get from the server.

    var editEle = dojo.create(data.elementType); (assuming data is the name of the variable you have your response and elementType is a property on that containing the type of element that needs to be created.

    You can also pass an object literal to the second argument of dojo.create to specify parameters on the node:
    dojo.create('input', {type: 'text'});

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created this NumberSpinner widget: <input name=form_action_fy id=form_action_fy value=2010 data-dojo-type=dijit.form.NumberSpinner data-dojo-smallDelta=1 data-dojo-largeDelta=1 data-dojo-constraints={min:2010,max:2030,places:0} />
I just created this dojo widget and now I want to attached an event
I've created a widget which I want to load via AMD in dojo 1.7.
this was my first dojo build so please excuse my ignorance in this matter.
I have created classes dojo.declare(UNIT,null,{ _id:'', constructor:function(i){ this._id=i; }); and dojo.declare(ELEMENT, null, { _id:'',
I am attempting to display a dynamically created SVG inline in a dojo based
I created a dojo chart using; var pieChart = new dojox.charting.Chart2D(pieChart); Afterwards I want
I am trying to filter data in the dojo grid widget, however, I am
Does anybody know how I can close all modal dialogs created by Dojo ?
I'm trying to create a DOJO DataGrid populated using a dojo.data.ItemFileReadStore with very simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.