2012-03-14 7 views
0

問題は、bottominfoの値を返す関数を作ったことです。jqgrid - フォームで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; 
       }; 

しかし、最初に私は、フォームを開くたびに、グリッドをロードしていないときに関数がのみ呼び出されます。フォームを開くたびにbottominfoを変更する方法はありますか?私は関数を呼び出す方法に問題が

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()}); 

あります:私は、そのメソッドを持っている :

は3を更新しましたか?

UPDATED 2

他のプロパティは本当に私のために参考になっていないので、私はそれらを消去します。他のコードは次のとおりです。

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; 
} 

答えて