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 8192603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:13:02+00:00 2026-06-07T04:13:02+00:00

I am developing an app where users can perform CRUD operations on multiple data

  • 0

I am developing an app where users can perform CRUD operations on multiple data models (aka. DB tables). I am using Dojo and I am quite happy with the dojox.grid module. But users also need to add records, so there has to be an Add Dialog for each table.

Is there a way/module that generates a Dojo grid and an Add Dialog given only the data structure of the model? Sort of like the structure parameter of dojox.grid, so that both the grid and the add Dialog have the same data types, default values, contraints etc.
Of course I could write a custom widget that would just do that but I am looking for something existing here.

  • 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-06-07T04:13:03+00:00Added an answer on June 7, 2026 at 4:13 am

    The answer is, no there is no such module. You’d need to build a derived dialog.

    Lets see whats needed;

    1. The current grid
    2. the grid layout (celltypes)
    3. names and labels (structure)

    Assuming there is one ‘Add contents’ button defined pr-grid and that this button ‘knows’ the ID of the said grid, its onClick function should fire up a form in dialog.

    While there are dijit.form Widgets there’s also a range of predefined cellTypes, residing under dojox/grid/cells/_base.js. Lets make a map where type and widget is 1to1:

        var map = [{
            type: 'dojox.grid.cells.Cell',
            dijit: 'dijit.form.TextBox'},
        {
            type: 'dojox.grid.cells.Bool',
            dijit: 'dijit.form.CheckBox'},
        {
            type: 'dojox.grid.cells.Select',
            dijit: 'dijit.form.Select'},
        {
            type: 'dojox.grid.cells.DateTextBox',
            dijit: 'dijit.form.DateTextBox'}
                 ];
    

    In our addContents function we will make use of the ‘editable’ functionality in the dojox.grid.DataGrid. When we know there’s a such – there is certainly also a function pr-cell that generates the DOM. This is the formatEditing function which is present in any cellType.

      // for instance
      dojox.grid.cells.Select.prototype.formatEditing( /* value */ "", /* row */ -1);
    

    Only thing thats needed is to construct the contents which should be shown in the dialog – following uses the above mentioned functionality and provides dijit suitable markup for presentation in a dijit.Dialog.

    function addContents(gridId) {
        var grid = dijit.byId(gridId);
        var contents = ['<form action="MySubmitUrl" data-dojo-type="dijit.form.Form"><table>'];
        dojo.forEach(grid.layout.cells, function(cell, idx) {
            var szHtml = cell.formatEditing("", -1);
            var dijitType = map.filter(function(e) {
                return e.type == cell.declaredClass;
            })[0].dijit;
            var name = grid.structure[0][idx].field;
            var label = grid.structure[0][idx].name;
            var elementMod = ' data-dojo-type="' + dijitType + '" id="' + name + '" name="' + name + '" ';
            contents.push('<tr><td>');
            contents.push('<label for="' + name + '">' + label + ': </label>');
            contents.push('</td><td>');
            contents.push(szHtml.replace(/^([^\ ]*)/, "$1" + elementMod));
            contents.push('</td></tr>');
        });
        contents.push('</table></form>');
        var dialog = new dijit.Dialog({
            content: contents.join("")
        });
        dialog.show();
    }
    

    The contents is easy style-able and should also supply a submit/cancel button but im certain you get the idea. Running sample

    Let me know how it runs (havent tested combobox / datetime types)

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

Sidebar

Related Questions

I'm developing a web app where users can get coupons and similar things. I
I am developing a BlackBerry app in which users can purchase virtual goods (such
I'm developing web app that user can save his/her work to server. The data
Im developoing an app for the iPhone where users can chat using their facebook
I'm developing an app using Silverlight control for Bing Maps . User can search
I am developing a Windows Phone app where users can update a list. Each
I'm developing an app through which users can send email messages with attachments. Both
I'm developing an app which will have a central database users can add entries
Basically I am developing an app which can show both the users' current location
I've just started playing with Red5 and am developing an app using which users

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.