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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:04:00+00:00 2026-05-28T03:04:00+00:00

I am facing a problem using jqgrid in custom edit mode. I built the

  • 0

I am facing a problem using jqgrid in “custom edit mode”.
I built the grid correctly with the buttons to edit / save / cancel / delete for each row.
For each button I bind a function to each operation (save, save, etc.)
My problem now is that when trying to check if the field is valid, the verification function is performed and the error dialog is triggered, but the value is submitted to the database, and the row is not kept in “edit mode” for the user correct the error.

I also wonder if it is possible to suppress the in-built error dialog, and just to highlight the fields with the error. the error messages would be shown as a summary in a div.

Thank you for your attention

My example with relevant code

// function to retrieve data to jqgrid
getList();

// grid configuration

$("#list").jqGrid({
    datatype: "local",
    width: 465,
    colNames: ["ID", "Descrição", ""],
    colModel: [
          { name: "id", index: "id", sorttype: "int", hidden: true },
          { name: "descr", index: "descr", editable: true, edittype: "text", editrules: { custom: true, custom_func: checkvalid }
          },
          { name: "action", index: "action", sortable: false, width: 90, search: false} // Botões

        ],
    loadtext: 'A carregar...',
    rowNum: 20,
    rowList: [20, 40, 80, 100, 200],
    ignoreCase: true,
    pager: "#pager",
    sortname: "id",
    viewrecords: true,
    sortorder: "asc",
    caption: "Gestão de tipos",

    gridComplete: function() {
        //load edit buttons
        var ids = $("#list").jqGrid("getDataIDs");
        for (var k = 0; k < ids.length; k++) {
            var id = ids[k];
            var html = "";
            html += "<input id=\"btnEdit" + id + "\" type=\"button\" class=\"JQbutton\" value=\"Editar\" onclick=\"jqGrid_editRow('" + id + "');\"  />";
            html += "<input id=\"btnDelete" + id + "\" type=\"button\" class=\"JQbutton\" value=\"Apagar\" onclick=\"jqGrid_deleteRow('" + id + "');\"  />";
            html += "<input id=\"btnSave" + id + "\" style=\"display: none;\" class=\"JQbutton\" type=\"submit\" value=\"Guardar\" onclick=\"jqGrid_doSave(" + id + ");\"  />";
            html += "<input id=\"btnCancel" + id + "\" style=\"display: none;\" class=\"JQbutton\" type=\"button\" value=\"Cancelar\" onclick=\"jqGrid_restoreRow('" + id + "');\" />";
            $("#list").jqGrid("setRowData", id, { action: html });
        }
    }

});


function checkvalid(value, colname) {
    //-... code to validate field 

    return [false, "testing validation"];

}
  • 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-28T03:04:01+00:00Added an answer on May 28, 2026 at 3:04 am

    You can validate the form fields in the beforeSubmit function. In this function you can validate the fields and add the highlight class to the element you want. You can do something like this:

    beforeSubmit: function(postdata, formid){ 
           //more validations
           if ($('#exec').val()==""){
                    $('#exec').addClass("ui-state-highlight");
                    return [false,'ERROR MESSAGE']; //error
          }
          return [true,'']; // no error
     },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing one problem in Tapestry. Problem - I am using a grid
I'm facing a problem that seems to have no straighforward solution. I'm using java.util.Map
I'm facing a problem when I need to distribute my java application, created using
I'm facing a problem using ExtJS4. My application has a tree containing a string
I am facing a problem while using Russian locale, Time Zone part of the
I am facing problem in getting Facebook data I am using Facebook SDK for
I'm facing a problem where both recursion and using a loop seem like natural
I'm facing lil problem using lambda with default_scope in rails 2.3. default_scope lambda {
I'm currently facing in problem using Core Data. I have two entities A and
I'm facing a problem using IE here. I need to insert a form on

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.