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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:39:20+00:00 2026-06-08T00:39:20+00:00

I’ve actually asked this question before, but haven’t achieved success with it back then,

  • 0

I’ve actually asked this question before, but haven’t achieved success with it back then, but I’m hoping this time round i’ll be luckier.

I’ve got a scenario where i need to have certain fields on a jqgrid modal remain populated after an add save action. (at the moment all the fields get cleared/reset to a default state). They’re not visible to the user, so when i try and save again, the validation prompts me to enter a date/manager/shift. I’ve tried various attempts to rectify this to noo success what so ever

I know its possible, as when a person edits and clicks save, the form does not get cleared. (I’m hoping i can do this selectively on the after save)

My screens look like this.

When adding

enter image description here

When Editing

enter image description here

The idea is when a user captures, they don’t need to update the date, shift & manager the whole time, as multiple records get captured against those sets of keys in one go, and it would be pretty annoying having to re-select those values on every go.

when adding takes place the form values get updated via the beforeShow hook. (and editing it’ll get ignored as i need to use the value in the grid, (in case a mistake was made)

Code snippet

    DataGrid.navGrid('#pager', { edit: true, add: true, del: true, search: true },
             editItems,
            {
                width: 600, 
                url: URL_add,
                data: submit_data,
                afterSubmit: function (result) {
                    success:
                    {
                        if (onAfterSubmit != null)
                            onAfterSubmit(result);

                        return Notify("success", result.responseText);
                    }
                    fail: { return Notify("error", result.responseText); }
                },                
                recreateForm: true,
                beforeShowForm: addBeforeShowOptions,
                modal: false,
                overlay: false,
                jqModal: true
            },
...

    var addBeforeShowOptions = function (form) {
        formPattern(form);
        $('#Date', form).val($('#main_Date').val());
        $('#Shift', form).val($('#main_Shift').val());
        $('#ManagerID', form).val($('#main_Manager').val());

        $('#tr_Date', form).hide();
        $('#tr_ManagerID', form).hide();
    }
  • 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-08T00:39:21+00:00Added an answer on June 8, 2026 at 12:39 am

    I found another way of solving this, instead of injecting the values into the modal during editing, i’m updating the postData just before the data gets submitted by using the serializeEditData hook.

    In my case it basically as simple as

    function (postData) {
        postData.Date = $('#main_Date').val();
        postData.DateShift = $('#main_Shift').val();
        postData.ManagerID = $('#main_Manager').val();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I need to clean up various Word 'smart' characters in user input, including 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.