0
저는 javascript가 새것이며 사이트를 유지해야합니다. 실제로는 여러 개의 카드를 하나의 탭에 하나씩 파일로 다운로드 할 수 있습니다. 사용자가 카드를 충분히 가질 수 있기 때문에 치료가 항상 성공할 수는 없습니다 (너무 많은 탭). 예를 들어 파일 evey 20 개의 탭을 만들고 싶었습니다. 파일을 만드는 루프의 마지막 구절 : 여러 파일, 거기해야 할 때 javascript - 여러 파일 다운로드
var printTerm = function(grid){
var rows = grid.selected;
if(rows==null) return;
var ids = rows.map(function(val){return grid.getDataByRow(val).num_terme;});
var nbMax = 20;
var nbFic;
var idsPartiel;
var posDebut;
var posFin;
var a;
if(ids.length > nbMax)
{
idsPartiel = ids;
if(ids.length % nbMax == 0) nbFic = ids.length/nbMax;
else nbFic = ((ids.length - (ids.length % nbMax))/nbMax) + 1;
for (i=0 ; i< nbFic ; i++)
{
posDebut = (nbMax * i);
if(i == nbFic - 1) posFin = idsPartiel.length + 1;
else posFin = posDebut + nbMax;
ids = idsPartiel.slice(posDebut,posFin);
a = new Element('a', 'id':'download','href':'php/utils/export2pdf.php?ids='+ids.join(',')})
.addEvent('click',function(){location.href=this.href;}).inject(document.body);
a.fireEvent('click');
a.dispose();
}
}
else
{
a = new Element('a',{'id':'download','href':'php/utils/export2pdf.php?ids='+ids.join(',')})
.addEvent('click',function(){location.href=this.href;}).inject(document.body);
a.fireEvent('click');
a.dispose();
}
};
카드의 수가 작거나 NBMAX 동일
, 그것은 잘 BU를 작동합니다. 방화범이 어떻게되는지 알아 내려고 할 때 치료 방법을 보지만 마지막 단계 만 끝납니다. 도와 주셔서 감사합니다.
고마워, 네가 맞아. 나는 이것을 시도 할 것이다. – Brice