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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:42:05+00:00 2026-06-16T01:42:05+00:00

Hi I have this navGrid definition in Add action. Grid.id >> $(#<%=Me.Id & _

  • 0

Hi I have this navGrid definition in Add action.

Grid.id >> $("#<%=Me.Id & "_" %>lstPreciosSUD")

{ width: 350, resize: false, closeAfterAdd: false, recreateForm: true,
    clearAfterAdd:false, viewPagerButtons: true, afterComplete: estadoReplicado,
    ,afterSubmit: function(response) { 
                if (response.responseText == "OK") {

                    alert("we are inside");

                    var myInfo = '<div class="ui-state-highlight ui-corner-all">' +
                        '<span class="ui-icon ui-icon-info" ' +
                        'style="float: left; margin-right: .3em;"></span>' +
                        '<span>Registro insertado correctamente!</span></div>',
                    $infoTr,
                    $infoTd;
                    $infoTr = $("#TblGrid" + "<%=Me.Id & "_" %>lstPreciosSUD" + ">tbody>tr.tinfo");
                    $infoTd = $infoTr.children("td.topinfo");
                    $infoTd.html(myInfo);
                    $infoTr.show();

                    setTimeout(function () {
                        $infoTd.children("div")
                            .fadeOut("slow", function () {
                                  $infoTr.hide();
                            });
                    }, 6000);

                        //alert("Registro creado.");
                        return [true,''];
                } 
                else { 
                        return [false, "Error creando precio de suplemento!"];
                } 
            },
    beforeSubmit: function(postdata){ 
        if ((postdata.tpb_importe == "") || (postdata.fini == "") || (postdata.ffin=="")) {
            return[false,"Importe y fechas es obligatorio!"]; 
        } else { return [true,""] }
    }
}}

In the second or date’s inputs if are empty this return (return [false,"Importe y fechas es obligatorio!"] ") returns me a red message in the dialog from beforeSubmit like this http://i.imgbox.com/ackwIZvQ.jpg

I have to use closeAfterAdd:false and clearAfterAdd:false in this case, but i want to know and i have think use afterSubmit to show a green (for example) message if its all OK with a little function to do this, but if i use the above afterSubmit function, and its OK, don’t show any message like error message, is possible to show any OK message? If there is an error, it shows it in red color I can’t see in background how it add the new record, but in the dialog don’t show any message.

Thanks.

  • 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-16T01:42:07+00:00Added an answer on June 16, 2026 at 1:42 am

    If I understand you correct you will find an example of such implementation in the answer (see the demo). It shows how to use add your custom text in the same way like the standard error message will be added. In the demo I used errorTextFormat only to simulate the loading. You should move the code which show successful message in afterSubmit.

    UPDATED: The code of afterSubmit could look about as (I don’t tested the code)

    afterSubmit: function (jqXHR) {
        var myInfo = '<div class="ui-state-highlight ui-corner-all">' +
                '<span class="ui-icon ui-icon-info" ' +
                'style="float: left; margin-right: .3em;"></span>' +
                '<span>The row is successfully added</span></div>',
            $infoTr,
            $infoTd;
    
        if (jqXHR.responseText !== "OK") {
            return [false, jqXHR.responseText];
        }
    
        $infoTr = $("#TblGrid_" + $.jgrid.jqID(this.id) + ">tbody>tr.tinfo"),
        $infoTd = $infoTr.children("td.topinfo");
        $infoTd.html(myInfo);
        $infoTr.show();
    
        // hide the info after 3 sec timeout
        setTimeout(function () {
            $infoTd.children("div")
                .fadeOut("slow", function () {
                    // Animation complete.
                      $infoTr.hide();
                });
        }, 3000);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have this code: <sj:head compressed=false jqueryui=true jquerytheme=custom/> <s:url id=link action=ABC namespace=/DEF escapeAmp=false/> <sj:a openDialog=_dialog
I have this function // add history paths and save data function AddPath( strTag,
i have this youtube url http://www.youtube.com/watch?v=9N51Etoikfw&feature=youtube_gdata i need to remove the feature parameter and
Hi I have created a user message page with this plugin. The grid will
Have this upload script, and it works. But I would like to add a
have this code: void set(list<Person*>* listP){ Person timmy = Person(10); listP->push_back(&timmy); } int main()
have this html: <div id=editable contentEditable=true > <span contentEditable=false >Text to delete</span> </div> need
in asp-mvc, i have a partial view which contains this: <table id=grid> </table> <div
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
Have this self-made slider: http://jsfiddle.net/wyc3P/4/ What it does: takes min and max values in

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.