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

  • SEARCH
  • Home
  • 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 471369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:58:44+00:00 2026-05-12T23:58:44+00:00

I am struggling with a simple dojo datagrid in my Zend Framework project. I

  • 0

I am struggling with a simple dojo datagrid in my Zend Framework project.

I have a list of data from a mysql table that I can display, however I want users to be able to remove selected rows (and remove them from the db). I am using the example from Dojo DataGrid adding and deleting data. My code in my view for the datagrid looks like this.

<div dojoType="dojo.data.ItemFileReadStore" jsId="skillstore" url="<?php echo $this->baseUrl()?>/skills/hist/<?php echo $this->histid;?>"></div>

<table id="skillgrid" jsId="skills" dojoType="dojox.grid.DataGrid" store="skillstore"   style="height:300px;width:500px;">
 <thead>
    <tr>
        <th field="skillid" hidden="true"></th>
        <th width="auto" field="skill">Skills</th>
    </tr>
        
</thead>
</table>
<div>
<button dojoType="dijit.form.Button" onclick="removeRows()" >Remove Selected Row</button>
<button dojoType="dijit.form.Button" onclick="addRow()">Add another skill</button>
</div>

I’ve placed the code for the removing of the rows inbetween the view scripts captureStart and captureEnd tags. The code for the removeRows() looks like this.

function removeRows(e){     
    var items = skillsgrid.selection.getSelected();
    
    if(items.length){
    
        dojo.forEach(items, function(selectedItem){
        
            if(selectedItem !== null){
                            
                skillstore.deleteItem(selectedItem);
            }//endif
        });//end foreach
    
    }//end if
}

The main problem I get is that when I select a row and click the button, firebugs complains that skillstore.deleteItem is not a function. I have yet to try and remove the entry from the database.

Any pointers would be much appreciated.

  • 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-12T23:58:44+00:00Added an answer on May 12, 2026 at 11:58 pm

    I think all you have to do is use the jsId attribute value as ID instead of the id one:

    var items = skills.selection.getSelected();
    

    EDIT:

    If that doesn’t work, did you add the following right after the closing body tag?

    <script type="text/javascript" src="dojo.js" djConfig="parseOnLoad: true">
    </script>
    <script type="text/javascript">
        dojo.require("dojox.grid.DataGrid");
        dojo.require("dojo.data.ItemFileWriteStore");
        dojo.require("dijit.form.Button");
    </script>
    

    EDIT2:

    Actually, you are using a read-only store, that is the problem.

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

Sidebar

Related Questions

I'm struggling to build a simple zend framework application that can call jQuery. So,
I am struggling pulling a simple list of records from one table object and
Just struggling with a simple issue with ASP.NET MVC. I have a list of
Rails newbie here struggling with a small project. I am creating a simple ship
I'm struggling with a (usually simple to deal with) problem. I have a database
I have created a very simple nested loop example and am struggling to write
I have been struggling with something which in theory should be very simple for
I have been struggling with what I feel is a simple JQuery selector issue,
I'm really struggling with something that should be a simple matter: Showing a user
I'm struggling with something that I am sure has a very simple method, but

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.