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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:22:27+00:00 2026-05-31T09:22:27+00:00

The problem is that i have made a function that gives back a value

  • 0

The problem is that i have made a function that gives back a value for bottominfo.

var bottominfo = function (){
        var vMonth = document.getElementById('cmb_Month').value;
                    var vYear = document.getElementById('Year').value;
                    var StartDate = firstdayofmonth(vMonth, vYear);
                    var EndDate = lastdayofmonth(vMonth, vYear);            
                    var next=getnext(StartDate,EndDate);
                    var bottominfo='You are going to add'+next;

                    alert(bottominfo);
                    return bottominfo;
                };

But the function is only called when first load the grid and not every time that i open a form. Is there a way to change bottominfo every time i open a form?

UPDATED 3:
I have that method:

  jQuery(list).jqGrid('navGrid',pager,{edit:true},
                {
                            width:colwidth*1.05,
                            height:"auto",
                            reloadAfterSubmit:true,
                            closeAfterAdd: true,
                            recreateForm: true,
                            drag: false,
                            onClose: after,
            bottominfo: bottominfo()});

Is there a problem with the way i call the function?

UPDATED 2

The other properties are not really helpfull for me, so i erased them. The other code is :

 function firstdayofmonth(vMonth, vYear){
return vYear+'-'+vMonth+'-01';
}

 function lastdayofmonth(vMonth, vYear){
var myDate=new Date();
var vMonth=parseInt(vMonth)+2;
var vYear=parseInt(vYear);
if (vMonth>12)
{vYear=vYear+1;
vMonth=vMonth-12;}
myDate.setFullYear(vYear, vMonth, 0);
return myDate.getFullYear()+'-'+(myDate.getMonth()+1)+'-'+myDate.getDate();
}

var nextprogram=0;


function getnext(StartDate,EndDate) {

next="Applications between"+StartDate+"and"+EndDate;
return next;
}
  • 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-31T09:22:28+00:00Added an answer on May 31, 2026 at 9:22 am

    Probably you should just use recreateForm: true property as additional option of “Add” and “Edit” settings (see here an example). I personally change $.jgrid.edit to use recreateForm: true as default in all projects which I made for the customers.

    Additionally you should replace one ; in your code to , because currently bottominfo variable are undefined and have to be interpreted as global. Some browsers will stop executing of the code in strict mode and interpret the case as an error. So just replace

    var next=getnext(StartDate,EndDate);
        bottominfo='You are going to add'+next;
    

    to

    var next=getnext(StartDate,EndDate),
        bottominfo='You are going to add'+next;
    

    UPDATED: You use bottominfo: bottominfo() as parameter of navGrid method. So the value for the will be set only once during the call. To be able to have dynamical bottominfo I can suggest you two ways:

    1) You can first call navGrid with add:false, edit:false options and then use navButtonAdd to add custom buttons which looks like the original “Add” and “Edit” buttons. Inside of the onClickButton callback you will get the rowid of currently selected row (get selrow parameter with respect of getGridParam) and then call editGridRow with all parameters which you need.

    2) Alternatively you can set any dummy string as bottominfo and overwrite it manually to another text manually. The code can be like the following

    $.extend($.jgrid.edit, {
        bottominfo: "dummy text",
        recreateForm: true,
        beforeShowForm: function ($form) {
            var $bottomInfo = $form.parent().find("table.EditTable td.bottominfo");
            $bottomInfo.html('<span style="color:red">Now: ' + new Date() + '</span>');
        }
    });
    

    see the demo:

    enter image description here

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

Sidebar

Related Questions

I have a problem with a javascript set of functions that I made. This
I have made a swings application but there is one problem in that which
Here's my problem: I have an unmanaged dll that I made.I'm calling one of
The problem that I have is somehow very specific. I have to implement a
I have encountered a problem that I have not come accross yet when setting
We have the problem that we have the open project files in our SVN
I have a problem that I have not faced before: It seems that the
i have bought a template that have built in contact form problem is that
I have been Googling a problem that I have with trying to integrate the
This is a really weird problem that I have been having. When I download

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.