当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - how can i check if exist like minimun one array in each panel?

问题描述:

I can create N panels , for example i have three now.

the panels are each white rectangle.

In each panel i can create N arrays , in this case the arrays are rows for a dinamyc table.

(this work when i click in a button)

now i need check if exist one array like minimun in each panel.

example: I create a row in panel 1, now i click the button, the message would be "error, complete the panel 2 or if i create a row in panel 2 "complete the panel 1 ".

i work dinamically and with modules.

¿what is the logic to do that in jq javascript?

this code in this module would validate:

validarBotonEnviar: function(idSeccion){

var self = this;

var aDataTareas = self.aListadoTareas[idSeccion];

$.each(aDataTareas, function(index,value) {

if (aDataTareas.length > 0){

oData = {};

oData.datos = aDataTareas;

oData.estado = true;

self.publishers("validBoton",oData);

}else{

oData = {};

oData.seccion = idSeccion;

oData.aceptar = false;

self.publishers("validBoton",oData);

}

});

and in this module i have the method with the button

AccionBotonEnviar: function(estado){

var self = this;

$("#btn_enviar_formulario_id").click(function(){

if(estado === true){

console.info("todo ok");

} else {

console.info("todo mal");

}

});

},

sorry my english and thanks

http://www.uppic.com/uploads/14298803131.jpg

分享给朋友:
您可能感兴趣的文章:
随机阅读: