Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Class extends TabSet error

$
0
0
SmartClient v90p 20/08/2013/ PowerEdition

I have a class created extends from TabSet. Error happends only in Internet Explorer, only versions lower than 10. In FF and Chrome works ok.
Is it a bug from version?

Code:

isc.defineClass("ModuloProveedor", "TabSet").addProperties({
    tabBarPosition: "top",
    autoDraw: false,
    width: "100%",
    height: "100%",
    // función utilizada para cargar el módulo de vehiculos en una ventana modal
    cargarVehiculos: function (PRVD_ID, VEHC_ID, NOMBRE, record, editRecord) {
            cargarModulovehiculos (PRVD_ID, VEHC_ID, NOMBRE, record, editRecord);
    },
    // esta funcion nos permite habilitar/deshabilitar ciertos campos al momento de crear/actualizar un registro
    deshabilitarCamposEdicionFormProveedores: function (editar) {
            this.formEdicionProveedores.getItem("PRVD_ID").setDisabled(editar);
            this.formEdicionProveedores.getItem("PLZS_ID").setDisabled(editar);
            this.formEdicionProveedores.getItem("FECHA_ALTA").setDisabled(editar);
    },
    //esta funcion nos permite habilitar/deshabilitar ciertos campos al momento de crear/actualizar
    habilitarCamposEdicionGrillaFormasPago: function (editar) {
            this.grillaDetalleFormasDePago.getField("TIPO_PAGO").canEdit = editar;
    },
    // FILTRO DE BUSQUEDA DE PROVEEDORES
    filtroProveedoresDefaults: {
            autoParent:"nivelBuscadorSeccionBuscador",
            _constructor: "AtlasFormularioFiltro",
            dataSource:"atbatProveedoresDS",
            autoFraw: false,
            fields:        [
                    {
                            name:"PLZS_ID",
                            optionDataSource:"atbatPlazasDS", valueField:"PLZS_ID", displayField:"NOMBRE_PLAZA",
                            disabled: !UsuarioAutenticado.esUsuarioCTR(), multiple:"true", MultipleAppearance:"picklist"
                },
                    {name:"PRVD_ID"},
                    {name:"ESTADO"},
                    {name:"NOMBRE"},
                    {
                            name:"TIPO_PROVEEDOR",  optionDataSource:"atxxvMtpvDS", valueField:"MTPV_ID",
                            displayField:"MTPV_TEXTO", multiple:"true", MultipleAppearance:"picklist"
                    },
                    {name:"NIFCIF"},
                    {name:"FECHA_ALTA", dateFormatter:"toEuropeanShortDate"},
                    {name:"FECHA_BAJA", dateFormatter:"toEuropeanShortDate"},
                    {       
                            name:"CLEM_ID", hint:"LOV", 
                            icons: [{
                            src: "[SKIN]/DynamicForm/default_formItem_icon.gif",
                            click: function(form, item, icon) {
                                    if (lovProveedor == null) {
                                            lovProveedor = isc.Lovs.create({
                                                    title: "Lista de Valores"
                                            });
                                            lovProveedor.showLov(atClemDS, "CLIENTE", form.getValue("CLEM_ID"),
                                                            true, {target: form, methodName: "lovCallback"});
                                    } else {
                                            lovProveedor.setTitle("Lista de Valores");
                                            lovProveedor.showLov(atClemDS, "CLIENTE", form.getValue("CLEM_ID"),
                                                            true, {target: form, methodName: "lovCallback"});
                                    }
                            }
                        }]
                    }
            ],
            lovCallback : function(records) {
                if (isA.Array(records)) {
                        var clientes = "";
                        for (var i = 0; i < records.length; i++) {
                                if (i == 0) {
                                        clientes += records[i].CLIENTE;       
                                } else {
                                        clientes += ", " + records[i].CLIENTE;
                                }
                        }
                        this.setValue("CLEM_ID", clientes);
                } else {
                        this.setValue("CLEM_ID", records.CLIENTE);
                }
        }
    },       
    // BOTONES UTILIZADOS PARA EL FILTRADO DE PROVEEDORES
    botonesFiltroProveedoresDefaults: {
            autoParent:"nivelBuscadorSeccionBuscador",
            _constructor: "HLayout",
            autoDraw: false
    },
    botonBuscarComoFiltroProveedorDefaults: {
            autoParent: "botonesFiltroProveedores",
            _constructor: "IButton",
            title: proveedoresUIDS.getField("proveedores.filtroBotonBuscarComo").title,
            autoDraw: false,
                click: function() {
                        var criteria = this.creator.filtroProveedores.getValuesAsCriteria();
                        if (typeof criteria.CLEM_ID !== "undefined") {
                                if (criteria.CLEM_ID.indexOf(",") != -1 ) {
                                        var clemId = criteria.CLEM_ID.split(",");
                                        // hacer bucle para borrar espacios en blanco
                                        isc.addProperties(criteria, {CLEM_ID: clemId});
                                }
                        }
                        if (!UsuarioAutenticado.esUsuarioCTR()) {
                                isc.addProperties(criteria, {PLZS_ID: UsuarioAutenticado.getUsuarioPlaza()});
                        }
                        this.creator.grillaProveedores.filterData(criteria);
                       
                        /*if (!UsuarioAutenticado.esUsuarioCTR()) {
                                var criteria = this.creator.filtroProveedores.getValuesAsCriteria();
                                isc.addProperties(criteria, {PLZS_ID: UsuarioAutenticado.getUsuarioPlaza()});
                                this.creator.grillaProveedores.filterData(criteria, {operationId:"filtros"});
                        } else {
                                this.creator.grillaProveedores.filterData(this.creator.filtroProveedores.getValuesAsCriteria(), {operationId:"filtros"});
                        }*/
                }
        },
        botonBuscarExactoFiltroProveedorDefaults: {       
                autoParent: "botonesFiltroProveedores",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.filtroBotonBuscarExacto").title,
                autoDraw: false,
                click: function() {
                        if (!UsuarioAutenticado.esUsuarioCTR()) {
                                var criteria = this.creator.filtroProveedores.getValuesAsCriteria();
                                isc.addProperties(criteria, {PLZS_ID: UsuarioAutenticado.getUsuarioPlaza()});
                                this.creator.grillaProveedores.fetchData(criteria);
                        } else {
                                this.creator.grillaProveedores.fetchData(this.creator.filtroProveedores.getValuesAsCriteria());
                        }
                }
        },
        botonLimpiarFiltroProveedorDefaults: {       
                autoParent: "botonesFiltroProveedores",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.filtroBotonLimpiarCriterios").title,
                width: 120, autoDraw: false,
                click: "this.creator.filtroProveedores.clearValues()"
        },
        grillaProveedoresDefaults: {
                autoParent:"nivelResultadosSeccionBuscador",
                _constructor: "AtlasGrilla",
                dataSource:"atbatProveedoresDS",
                editEvent:"none",
                autoDraw: false,
                canExpandRecords: true,
                canExpandMultipleRecords: false,
            //maxExpandedRecords: 2, cuando canExpandMultipleRecords es true
                recordDoubleClick: function  (viewer, record, recordNum, field, fieldNum, value, rawValue) {
                        this.creator.formDetalleDatosPlaza.clearErrors(true);
                        this.creator.formDetalleDatosPlaza.clearCellHilites();
                        this.creator.formEdicionProveedores.clearErrors(true);
                        this.creator.formEdicionProveedores.clearCellHilites();
                        this.creator.deshabilitarCamposEdicionFormProveedores(true);
                       
                        this.creator.formEdicionProveedores.editSelectedData(this.creator.grillaProveedores);
                        this.creator.formDetalleDatosPlaza.editSelectedData(this.creator.grillaProveedores);
                        // recuperamos la información relacionada al registro seleccionado
                        // en las grillas: vehículos, otras plazas y formas de pago
                        var criteriaVeh= {
                                PRVD_ID: record.PRVD_ID
                        };
                        this.creator.grillaDetalleVehiculos.fetchData(criteriaVeh);
                        this.creator.layoutDetalleOtrasPlazas.grillaDetalleOtrasPlazasDetail.fetchData(criteriaVeh);
                        this.creator.grillaDetalleFormasDePago.fetchData(criteriaVeh);
               
                        //debemos asignar el codigo de proveedor a la variable encargada de procesar Otras Plazas
                        this.creator.layoutDetalleOtrasPlazas.grillaDetalleOtrasPlazasDetail._PRVD_ID = record.PRVD_ID;
                       
                        this.creator.selectTab(1);
                },
            createRecordComponent : function (record, colNum) { 
                var fieldName = this.getFieldName(colNum); 
                if (fieldName == "Acciones") { 
                    var recordCanvas = null;
                    var modulo = this.creator;
                    if (UsuarioAutenticado.esUsuarioCTR()) {
                            var botonEdicion = isc.AtlasImgBoton.create({
                                            src: Page.getAppImgDir()+"/grideditar.png",
                                            prompt: "Editar",
                                            click: function () {
                                                    modulo.grillaProveedores.startEditing(modulo.grillaProveedores.getEventRow());
                                                    asignarReferenciaGrillaProveedores(modulo.grillaProveedores);
                                            }
                                        });
                            recordCanvas = isc.BotonesParaEdicionesGrilla.create({
                                    _modulo : modulo,
                                    _grillaOrigen : modulo.grillaProveedores,
                                    _botonEdicion : botonEdicion,
                                    funcionXInvocar : function(grilla) {
                                            grillaProveedores = grilla;
                                            //alert("22");
                                },
                            });
                                   
                                    /*isc.HLayout.create({
                            height: 22,
                            align: "left",
                            members: [
                                                    isc.AtlasImgBoton.create({
                                                        src: Page.getAppImgDir()+"//grideditar.png",
                                                        prompt: "Editar",
                                                        click: function () {
                                                                modulo.grillaProveedores.startEditing(modulo.grillaProveedores.getEventRow());
                                                                asignarReferenciaGrillaProveedores(modulo.grillaProveedores);
                                                        }
                                                    }),
                                        isc.AtlasImgBoton.create({
                                            src: Page.getAppImgDir()+"/gridgrabar.png",
                                            prompt: "Grabar",
                                                            click: function () {
                                                                    modulo.grillaProveedores.endEditing();                                       
                                            }
                                        }),
                                        isc.AtlasImgBoton.create({
                                            src: Page.getAppImgDir()+"/gridcancelar.png",
                                            prompt: "Cancelar",
                                            click: function () {
                                                    modulo.grillaProveedores.cancelEditing();                                       
                                            }
                                        }),
                                        isc.AtlasImgBoton.create({
                                            src: Page.getAppImgDir()+"/AccesoForm.png",
                                            prompt: "Acceso Form",
                                                            click: function () {
                                                                    modulo.formDetalleDatosPlaza.clearErrors(true);
                                                                    modulo.formDetalleDatosPlaza.clearCellHilites();
                                                                    modulo.formEdicionProveedores.clearErrors(true);
                                                                    modulo.formEdicionProveedores.clearCellHilites();
                                                                    modulo.deshabilitarCamposEdicionFormProveedores(true);

                                                                    modulo.formEdicionProveedores.editSelectedData(modulo.grillaProveedores);
                                                                    modulo.formDetalleDatosPlaza.editSelectedData(modulo.grillaProveedores);
                                                                    // recuperamos la información relacionada al registro seleccionado
                                                                    // en las grillas: vehículos, otras plazas y formas de pago
                                                                    var criteriaVeh= {
                                                                            PRVD_ID: record.PRVD_ID
                                                                    };
                                                                    modulo.grillaDetalleVehiculos.fetchData(criteriaVeh);
                                                                    modulo.layoutDetalleOtrasPlazas.grillaDetalleOtrasPlazasDetail.fetchData(criteriaVeh);
                                                                    modulo.grillaDetalleFormasDePago.fetchData(criteriaVeh);
                                                           
                                                                    modulo.selectTab(1);
                                                            }
                                        })     
                            ]
                        });*/
                    } else {
                            recordCanvas = isc.HLayout.create({
                            height: 22,
                            align: "left",
                            members: [
                                        isc.AtlasImgBoton.create({
                                            src: Page.getAppImgDir()+"/AccesoForm.png",
                                            prompt: "Acceso Form",
                                                            click: function () {
                                                                    modulo.formDetalleDatosPlaza.clearErrors(true);
                                                                    modulo.formDetalleDatosPlaza.clearCellHilites();
                                                                    modulo.formEdicionProveedores.clearErrors(true);
                                                                    modulo.formEdicionProveedores.clearCellHilites();
                                                                    modulo.deshabilitarCamposEdicionFormProveedores(true);

                                                                    modulo.formEdicionProveedores.editSelectedData(modulo.grillaProveedores);
                                                                    modulo.formDetalleDatosPlaza.editSelectedData(modulo.grillaProveedores);
                                                                    // recuperamos la información relacionada al registro seleccionado
                                                                    // en las grillas: vehículos, otras plazas y formas de pago
                                                                    var criteriaVeh= {
                                                                            PRVD_ID: record.PRVD_ID
                                                                    };
                                                                    modulo.grillaDetalleVehiculos.filterData(criteriaVeh);
                                                                    modulo.layoutDetalleOtrasPlazas.grillaDetalleOtrasPlazasDetail.filterData(criteriaVeh);
                                                                    modulo.grillaDetalleFormasDePago.filterData(criteriaVeh);

                                                                    modulo.selectTab(1);
                                                            }
                                        })     
                            ]
                        });
                    }
                    return recordCanvas; 
                } else { 
                    return null; 
                } 
            },
        // TODOS LOS CAMPOS DEBEN LLEVAR ESTAS TRES PROPIEDADES
//                canFilter:false,        // Poner a false si es un campo que está en el buscador
//                canEdit: true,                // Poner a false si no se puede actualizar o se actualiza dinámicamente
//                showIf:"true"                // Poner a "false" si no se desea que se vea en el grid inicial pero si sale en las columnas utilizables
                fields: [
                        {name: "Acciones", title: " ", width: ((!UsuarioAutenticado.usuarioPuedeModificar("usuarioPuedeModificar")) ? 70 : 20),
                                canEdit: "false",        canFilter: false,        autoFreeze: true},
                        {name:"NIFCIF", width:100, canFilter:false, canEdit: true, showIf:"true"},
                        {name:"NOMBRE", width:200, canFilter:false, canEdit: true, showIf:"true"},
                        {
                                name:"TIPO_PROVEEDOR", optionDataSource:"atxxvMtpvDS", valueField:"MTPV_ID",
                    displayField:"MTPV_TEXTO", width:100, canFilter:false,        canEdit: true, showIf:"true"
                        },
                        {
                                name:"CLEM_ID", hint:"LOV",
                                icons: [{
                                    src: "[SKIN]/DynamicForm/default_formItem_icon.gif",
                                    click: function(form, item, icon) {
                                            var grilla = obtenerReferenciaGrillaProveedores();
                                            if (lovProveedor == null) {
                                                      lovProveedor = isc.Lovs.create({
                                                        title: "Lista de Valores"
                                                });
                                                lovProveedor.showLov(atClemDS, "CLIENTE", item.getValue (),
                                                        false, {target: grilla, methodName: "lovCallback"});
                                        } else {
                                                lovProveedor.setTitle("Lista de Valores");
                                                lovProveedor.showLov(atClemDS, "CLIENTE", item.getValue (),
                                                        false, {target: grilla, methodName: "lovCallback"});
                                        }
                                    }
                                }]
                        },
                        {
                                name:"CLEM_NOMBRE",        optionDataSource:"atClemDS", valueField:"CLIENTE", displayField:"NOMBRE",
                                width:200, canFilter:false, canEdit: false,        showIf:"true"
                        },
                        {name:"DIRECCION", canFilter:true, canEdit: true, showIf:"true",        width:150},
                        {name:"POBLACION", canFilter:true, canEdit: true, showIf:"true",        width:150},
                        {name:"COD_POSTAL", canFilter:true, canEdit: true, showIf:"true", width:80},
                        {name:"TELEFONO", canFilter:true, canEdit: true, showIf:"true", width:100},
                        {name:"PRVD_ID",        width:80, canFilter:false, canEdit: false, showIf:"true"},
                        {name:"PLZS_ID", width:40, canFilter:false, canEdit: false, showIf:"true"},
                        {name:"FAX", width:100, canFilter:true, canEdit: true, showIf:"false"},
                        {name:"FECHA_ALTA", dateFormatter:"toEuropeanShortDatetime",width:80, canFilter:false, canEdit: false, showIf:"false"},
                        {name:"FECHA_BAJA", dateFormatter:"toEuropeanShortDatetime", width:80, canFilter:false, canEdit: true, showIf:"false"},
                        {name:"USER_ALTA", width:150, canFilter:true, showIf:"false"},
                        {name:"USER_MOD", width:150, canFilter:true, showIf:"false"},
                        {name:"FEC_ALTA", dateFormatter:"toEuropeanShortDatetime", width:100, canFilter:true,        showIf:"false"},
                        {name:"FEC_MOD", dateFormatter:"toEuropeanShortDatetime", width:100, canFilter:true, showIf:"false"},
                        {name:"ESTADO", width:60, canFilter:false, canEdit: false, showIf:"false"}
                ],
                lovCallback : function(records) {
                    if (isA.Array(records)) {
                    } else {
                            var row = this.getEditRow ();
                            this.setEditValue(row, "CLEM_ID", records.CLIENTE);
                            this.setEditValue(row, "CLEM_NOMBRE", records.NOMBRE);
                    }
            },
            getExpansionComponent : function (record, rowNum, colNum) {
                    var vLayout = isc.LayoutTabProvOtrasPlazas.create({});
                    vLayout.grillaDetalleOtrasPlazasDetail.recordSelected = record;
                    vLayout.grillaDetalleOtrasPlazasDetail._PRVD_ID = record.PRVD_ID;
                    vLayout.grillaDetalleOtrasPlazasDetail.filterData({PRVD_ID: record.PRVD_ID});
                return vLayout;
            }
        },
        // BOTONES RESPECTIVOS PARA EL MANEJO DE LA GRILLA DE PROVEEDORES
        botonesGrillaProveedoresDefaults: {
                autoParent:"nivelResultadosSeccionBuscador",
                _constructor: "HLayout",
                autoDraw: false
        },
        botonGrillaFiltroProveedorDefaults: {
                autoParent: "botonesGrillaProveedores",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.grillaResultadosBotonVerFiltro").title,
                autoDraw: false,
                click:  function () {
                        if (this.creator.grillaProveedores.showFilterEditor == true) {
                                this.creator.grillaProveedores.setShowFilterEditor(false);
                                this.setTitle(proveedoresUIDS.getField("proveedores.grillaResultadosBotonVerFiltro").title);
                        } else {
                                this.creator.grillaProveedores.setShowFilterEditor(true);
                                this.setTitle(proveedoresUIDS.getField("proveedores.grillaResultadosBotonOcultarFiltro").title);
                        }
                }
        },
        botonGrillaExcelProveedorDefaults: {
                autoParent: "botonesGrillaProveedores",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.grillaResultadosBotonExcel").title,
                autoDraw: false,
                click: function () {
                        this.creator.grillaProveedores.dataFetchMode="basic";
                        this.creator.grillaProveedores.exportData({
                                exportAs: "csv",
                                exportDisplay: "download",
                                exportFields: ["PRVD_ID", "NOMBRE", "NIFCIF", "TIPO_PROVEEDOR", "DIRECCION"]
                        });
                }
        },
        botonGrillaInformeProveedorDefaults: {
                autoParent: "botonesGrillaProveedores",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.grillaResultadosBotonJasper").title,
                autoDraw: false,
                click: function () {
                        this.creator.grillaProveedores.dataFetchMode="basic";
                        this.creator.grillaProveedores.exportClientData({
                                exportAs: "xml",
                                exportDisplay: "download",
                                exportFields: ["PRVD_ID", "NOMBRE", "NIFCIF", "TIPO_PROVEEDOR", "DIRECCION"]
                        });
                }
        },
        ////////SECCIÓN FORMULARIO//////////////
        // FORM de PROVEEDORES 
        formEdicionProveedoresDefaults: {
                autoParent:"seccionForm",
                _constructor: "AtlasFormulario",
                dataSource:"atbatProveedoresDS",
                ID: "formEdicionformularioProvee",
                numCols:6,autoDraw: false,
                colWidths:[20,200,20,200,20,200],
                fields: [
                        {name:"PRVD_ID", disabled: true, width:80},
                        {
                                name:"PLZS_ID",        optionDataSource:"atbatPlazasDS", valueField:"PLZS_ID", displayField:"NOMBRE_PLAZA",
                                editorType:"ComboBoxItem", disabled: true,
                                getPickListFilterCriteria : function () {
                            if (UsuarioAutenticado.esUsuarioCTR()) return {};
                            else return {PLZS_ID:UsuarioAutenticado.getUsuarioPlaza()};
                        },
                            changed : function (form, item, value) {
                                    form.clearValue("PRVI_ID");
                                    form.getField ("PRVI_ID")._plaza = value;
                                    form.getField ("PRVI_ID")._form = form;
                        }
                        },
                        {name:"NOMBRE",        width:"*"},
                        {name:"NIFCIF",        width:150},
                        {
                                name:"TIPO_PROVEEDOR", optionDataSource:"atxxvMtpvDS", valueField:"MTPV_ID", displayField:"VALOR",
                                editorType:"ComboBoxItem"
                        },
                        {
                                name:"TPPR_ID",        optionDataSource:"atxxvTpprDS", valueField:"TPPR_ID", displayField:"TPPR_TEXTO",
                                editorType:"ComboBoxItem"
                        },
                        {name:"DIRECCION", startRow:true, width:250},
                        {name:"POBLACION", width:"*"},
                        {
                                name:"PRVI_ID",        optionDataSource:"atbatProvinciasDS", valueField:"PRVI_ID", displayField:"NOMBRE",
                                editorType:"ComboBoxItem", validateOnExit:"true", stopOnError:"true",
                                getPickListFilterCriteria : function () {
                                        //alert(this._form.getValue ("PRVI_ID"));
                            return {
                                    PLZS_ID:this._plaza//,
                                    //NOMBRE : "PUERTO"
                                    };
                        },
                        addUnknownValues:false,
                        filterFields:["NOMBRE"],
                        pickListWidth:300,
                        pickListFields:[
                            {name:"PRVI_ID"},
                            {name:"NOMBRE"}
                        ]
                        },
                        {name:"COD_POSTAL", width:80},
                        {name:"TELEFONO", width:100},
                        {name:"FAX",        width:100},
                        {
                                name:"SOCD_ID",        hint:"LOV",
                                icons: [{
                                    src: "[SKIN]/DynamicForm/default_formItem_icon.gif",
                                    click: function(form, item, icon) {
                                              if (lovProveedor == null) {
                                                      lovProveedor = isc.Lovs.create({
                                                              title: "Lista de Valores - Sociedades"
                                                      });
                                                      lovProveedor.showLov(atbatSociedadesDS, "SOCD_ID", form.getValue("SOCD_ID"),
                                                                    false, {target: form, methodName: "lovSociedadesCallback"});
                                              } else {
                                                      lovProveedor.setTitle("Lista de Valores - Sociedades");
                                                      lovProveedor.showLov(atbatSociedadesDS, "SOCD_ID", form.getValue("SOCD_ID"),
                                                                      false, {target: form, methodName: "lovSociedadesCallback"});
                                              }
                                    }
                                }]
                        },
                        {name:"SOCD_NOMBRE"},
                        {name:"PROFESIONAL"},
                        {
                                name:"CLEM_ID", hint:"LOV", 
                                icons: [{
                                src: "[SKIN]/DynamicForm/default_formItem_icon.gif",
                                click: function(form, item, icon) {
                                        if (lovProveedor == null) {
                                                lovProveedor = isc.Lovs.create({
                                                        title: "Lista de Valores - Proveedores"
                                                });
                                                lovProveedor.showLov(atClemDS, "CLIENTE", form.getValue("CLEM_ID"),
                                                                false, {target: form, methodName: "lovCallback"});
                                        } else {
                                                lovProveedor.setTitle("Lista de Valores - Proveedores");
                                                lovProveedor.showLov(atClemDS, "CLIENTE", form.getValue("CLEM_ID"),
                                                                false, {target: form, methodName: "lovCallback"});
                                        }
                                }
                            }],
                        blur : function(form, item) {
                                var criteria = {
                                        CLIENTE : item.getValue()
                                };
                                _form = form;
                                atClemDS.fetchData(criteria, function(dsResponse,data) {
                                        if (data.length == 1) _form.setValue("CLEM_NOMBRE", data[0].NOMBRE);
                                        else _form.setValue("CLEM_NOMBRE", "CLIENTE NO EXISTE");
                                });
                        }
                        },
                        {name:"CLEM_NOMBRE"},
                        {name:"IND_ADR"},
                        {name:"FECHA_ALTA", disabled: true, dateFormatter:"toEuropeanShortDatetime", useTextField:"true", width:90, startRow:true},
                        {name:"FECHA_BAJA", dateFormatter:"toEuropeanShortDatetime", useTextField:"true", width:90},
                        {name:"ESTADO", width:90},
                        {name:"FEC_ALTA", width:100, dateFormatter:"toEuropeanShortDatetime", startRow:true},
                        {name:"USER_ALTA", width:"*"},
                        {name:"FEC_MOD",        width:100, dateFormatter:"toEuropeanShortDatetime", startRow:true},
                        {name:"USER_MOD", width:"*"}
            ],
            lovCallback : function(records) {
                    if (isA.Array(records)) {
                            //  hacer tratamiento para array
                    } else {
                            this.setValue("CLEM_ID", records.CLIENTE);
                            this.setValue("CLEM_NOMBRE", records.NOMBRE);       
                    }
            },
            lovSociedadesCallback : function(records) {
                    if (isA.Array(records)) {
                            //  hacer tratamiento para array
                    } else {
                            this.setValue("SOCD_ID", records.SOCD_ID);
                            this.setValue("SOCD_NOMBRE", records.NOMBRE);
                    }
            }
        },
        formBotonesEdicionProveedoresDefaults: {
                autoParent:"seccionForm",
                _constructor: "HLayout",
                autoDraw: false
        },
       
        registroAnterior : null,
        indiceGrilla : -1,
       
        botonFormProveedorNuevoDefaults: {
                autoParent: "formBotonesEdicionProveedores",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formBotonNuevo").title,
                disabled : !UsuarioAutenticado.esUsuarioCTR(),
                autoDraw: false,
                click : function () {
                        if (!UsuarioAutenticado.esUsuarioCTR()) {
                                isc.warn("No tiene permiso para registrar nueva informaci&oacute;n");
                                return;
                        }
                        this.creator.registroAnterior = this.creator.formEdicionProveedores.getValues();
                        this.creator.indiceGrilla = this.creator.grillaProveedores.getRecordIndex (this.creator.grillaProveedores.getSelectedRecord());
                       
                        this.creator.grillaProveedores.deselectAllRecords();
                        this.creator.formEdicionProveedores.editNewRecord();
                        this.creator.formDetalleDatosPlaza.editNewRecord();
                        this.creator.formDetalleDatosPlaza.clearErrors(true);
                        this.creator.formDetalleDatosPlaza.clearCellHilites();
                        this.creator.formEdicionProveedores.clearErrors(true);
                        this.creator.formEdicionProveedores.clearCellHilites();
                       
                        this.creator.deshabilitarCamposEdicionFormProveedores(false);
                        // limpiamos las grillas al crear un nuevo registro
                        this.creator.grillaDetalleVehiculos.setData([]);
                        this.creator.layoutDetalleOtrasPlazas.grillaDetalleOtrasPlazasDetail.setData([]);
                        this.creator.grillaDetalleFormasDePago.setData([]);
                }
        },
        botonFormProveedorAnteriorDefaults: {       
                autoParent: "formBotonesEdicionProveedores",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formBotonAnterior").title,
                autoDraw: false,
                click : function () {
                        if (this.creator.formEdicionProveedores.isNewRecord()) {
                                return;
                        }
                        if (this.creator.formEdicionProveedores.valuesHaveChanged()) {
                                isc.say("El registro actual tiene cambios aplicados. No podr&aacute; utilizar &eacute;sta opci&oacute;n hasta finalizar o cancelar la presente edici&oacute;n");
                                return;
                        }
                        this.creator.formEdicionProveedores.clearErrors(true);
                        this.creator.formEdicionProveedores.clearCellHilites();
                        var index = this.creator.grillaProveedores.getRecordIndex (this.creator.grillaProveedores.getSelectedRecord());
                if (index > 0) {
                    var rec = this.creator.grillaProveedores.data.getRange(index - 1, index);
                    rec = rec[0];  // getRange() retorna un array
                    if (!Array.isLoading(rec)) {
                        // El registro esta en nuestro array, asi que simplemente nos movemos al siguiente registro
                            this.creator.grillaProveedores.deselectAllRecords();
                            this.creator.grillaProveedores.selectRecord(this.creator.grillaProveedores.getRecord(index - 1));
                            this.creator.formEdicionProveedores.editSelectedData(this.creator.grillaProveedores);
                            this.creator.formDetalleDatosPlaza.editSelectedData(this.creator.grillaProveedores);
                            this.actualizarGrillasDependientes();
                    } else {
                            // El registro no esta presente actualmente, pero el hecho de llamar a getRange() hizo
                            // que SmartClient iniciara la solicitud de ese registro (y de la página entera donde
                            // éste recide). Todo lo que tenemos que hacer es lo mismo que en el bloque de arriba
                            // cuendo llegue el registro. Ver dataArrived
                        this._pendingMoveToRecord = index - 1;
                    }
                }
            },
            dataArrived : function(start, end) {
            if (this._pendingMoveToRecord === null) return;
            if (start > this._pendingMoveToRecord || end <= this._pendingMoveToRecord) return;
            this.creator.grillaProveedores.deselectAllRecords();
            this.creator.grillaProveedores.selectRecord(this.creator.grillaProveedores.getRecord(this._pendingMoveToRecord));
            this.creator.formEdicionProveedores.editSelectedData(this.creator.grillaProveedores);
            this.creator.formDetalleDatosPlaza.editSelectedData(this.creator.grillaProveedores);
            this._pendingMoveToRecord = null;
            this.actualizarGrillasDependientes();
        },
        actualizarGrillasDependientes : function() {
                        var codProveedor = this.creator.formEdicionProveedores.getValue("PRVD_ID");
                        // recuperamos la información necesaria del fomulario de edición del proveedor
                        var criteria= {
                                PRVD_ID: codProveedor
                        };
                       
                        var tabSelected = this.creator.tabProveedoresDetalle.getSelectedTab();
               
                var members = tabSelected.pane.getMembers();
                for (var i = 0; i < members.length-1; i++) {
                        if (isA.ListGrid(members[i])) members[i].fetchData(criteria);
                }
               
                        /*this.creator.grillaDetalleVehiculos.fetchData(criteria);
                        this.creator.layoutDetalleOtrasPlazas.grillaDetalleOtrasPlazasDetail.fetchData(criteria);
                        this.creator.grillaDetalleFormasDePago.fetchData(criteria);
                // por ahora limpiaremos las grillas
                this.creator.grillaDetalleVehiculos.setData([]);
                        this.creator.layoutDetalleOtrasPlazas.grillaDetalleOtrasPlazasDetail.setData([]);
                        this.creator.grillaDetalleFormasDePago.setData([]);*/
        }
        },
        botonFormProveedorSigDefaults: {       

                autoParent: "formBotonesEdicionProveedores",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formBotonSiguiente").title,
                autoDraw: false,
                click : function () {
                        if (this.creator.formEdicionProveedores.isNewRecord()) {
                                return;
                        }
                        if (this.creator.formEdicionProveedores.valuesHaveChanged()) {
                                isc.say("El registro actual tiene cambios aplicados. No podr&aacute; utilizar &eacute;sta opci&oacute;n hasta finalizar o cancelar la presente edici&oacute;n");
                                return;
                        }
                        this.creator.formEdicionProveedores.clearErrors(true);
                        this.creator.formEdicionProveedores.clearCellHilites();
                        var index = this.creator.grillaProveedores.getRecordIndex (this.creator.grillaProveedores.getSelectedRecord());
                if ((index + 1) < this.creator.grillaProveedores.getTotalRows()) {
                    var rec = this.creator.grillaProveedores.data.getRange(index + 1, index + 2);
                    rec = rec[0];  // getRange() retorna un array
                    if (!Array.isLoading(rec)) {
                            // El registro esta en nuestro array, asi que simplemente nos movemos al siguiente registro
                            this.creator.grillaProveedores.deselectAllRecords();
                            this.creator.grillaProveedores.selectRecord(this.creator.grillaProveedores.getRecord(index + 1));
                            this.creator.formEdicionProveedores.editSelectedData(this.creator.grillaProveedores);
                            this.creator.formDetalleDatosPlaza.editSelectedData(this.creator.grillaProveedores);
                            this.actualizarGrillasDependientes();
                    } else {
                            // El registro no esta presente actualmente, pero el hecho de llamar a getRange() hizo
                            // que SmartClient iniciara la solicitud de ese registro (y de la página entera donde
                            // éste recide). Todo lo que tenemos que hacer es lo mismo que en el bloque de arriba
                            // cuendo llegue el registro. Ver dataArrived
                        this._pendingMoveToRecord = index + 1;
                    }
                }
            },
            dataArrived : function(start, end) {
            if (this._pendingMoveToRecord === null) return;
            if (start > this._pendingMoveToRecord || end <= this._pendingMoveToRecord) return;
            this._pendingMoveToRecord = null;
            /*this.creator.grillaProveedores.deselectAllRecords();
            this.creator.grillaProveedores.selectRecord(this.creator.grillaProveedores.getRecord(this._pendingMoveToRecord));
            this.creator.formEdicionProveedores.editSelectedData(this.creator.grillaProveedores);
            this.creator.formDetalleDatosPlaza.editSelectedData(this.creator.grillaProveedores);
           
            this.actualizarGrillasDependientes();*/
        },
        actualizarGrillasDependientes : function() {
                        var codProveedor = this.creator.formEdicionProveedores.getValue("PRVD_ID");
                        // recuperamos la información necesaria del fomulario de edición del proveedor
                        var criteria= {
                                PRVD_ID: codProveedor
                        };
                        //this.creator.grillaDetalleVehiculos.fetchData(criteria);
                        //this.creator.layoutDetalleOtrasPlazas.grillaDetalleOtrasPlazasDetail.fetchData(criteria);
                // por ahora limpiaremos las grillas
                        //layoutDetalleOtrasPlazas
                       
                var tabSelected = this.creator.tabProveedoresDetalle.getSelectedTab();
               
                var members = tabSelected.pane.getMembers();
                for (var i = 0; i < members.length-1; i++) {
                        if (isA.ListGrid(members[i])) members[i].fetchData(criteria);
                }
               
                        /*
                        if (tabSelected.idtab = "formasDePago") {
                        this.creator.grillaDetalleFormasDePago.fetchData(criteria);       
                } else if (tabSelected.idtab = "d") {
               
                this.creator.grillaDetalleVehiculos.setData([]);
                        this.creator.layoutDetalleOtrasPlazas.grillaDetalleOtrasPlazasDetail.setData([]);
                        this.creator.grillaDetalleFormasDePago.setData([]);*/
        }
        },
        botonFormProveedorGrabarDefaults: {       
                autoParent: "formBotonesEdicionProveedores",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formBotonGrabar").title,
                disabled : !UsuarioAutenticado.esUsuarioCTR(),
                autoDraw: false,
                click : function () {
                        // verificamos si el usuario puede registrar/actualizar los datos del formulario
                        if (!UsuarioAutenticado.esUsuarioCTR()) {
                                isc.warn("No tiene permisos para modicar el registro");
                                return;
                        }
                        // lo siguiente esta basado en lo comentado en el doc. tecnico
                        /*if (!formEdicionProveedores.isNewRecord()) {
                                if (UsuarioAutenticado.usuarioPuedeModificar("usuarioPuedeModificar")) {
                                        isc.warn("No tiene permisos para modicar el registro");
                                        return;
                                }
                        }*/
                        if (this.creator.formEdicionProveedores.valuesHaveChanged()) {
                                // aplicamos algunas validaciones
                                if ((this.creator.formEdicionProveedores.getValue("TIPO_PROVEEDOR") == "R") &&
                                        ((this.creator.formEdicionProveedores.getValue("CLEM_ID") == null) ||
                                                        (this.creator.formEdicionProveedores.getValue("CLEM_ID") == "undefined")))
                                {
                                        isc.warn("El campo '"+atbatProveedoresDS.getField("CLEM_ID").title+"' es obligatorio. Verificar");
                                        return;
                                }
                                var modulo = this.creator;
                                this.creator.formEdicionProveedores.saveData(function(dsResponse, data) {
                                        if (dsResponse.status >= 0) {
                                                modulo.formEdicionProveedores.clearCellHilites();
                                                modulo.formDetalleDatosPlaza.clearCellHilites();
                            if (modulo.formEdicionProveedores.isNewRecord()) {
                                    modulo.formEdicionProveedores.clearValues();
                                    modulo.formDetalleDatosPlaza.clearValues();
                                    modulo.formEdicionProveedores.editRecord(data);
                                    modulo.formDetalleDatosPlaza.editRecord(data);
                                                }
                            this.creator.deshabilitarCamposEdicionFormProveedores(true);
                                        }
                });
                        } else {
                                isc.say("No se realiz&oacute; ning&uacute;n cambio en los datos");
                        }
                        //this.creator.deshabilitarCamposEdicionFormProveedores(true);
                }
        },
        botonFormProveedorCancelarDefaults: {       
                autoParent: "formBotonesEdicionProveedores",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formBotonCancelar").title,
                disabled : !UsuarioAutenticado.esUsuarioCTR(),
                autoDraw: false,
                click : function () {
                        this.creator.formEdicionProveedores.reset();
                        this.creator.formEdicionProveedores.clearCellHilites();
                        if (this.creator.registroAnterior != null ) {
                                this.creator.formEdicionProveedores.editRecord(this.creator.registroAnterior);
                                this.creator.grillaProveedores.selectRecord(this.creator.indiceGrilla);
                        }
                }
        },
        ///// DETALLE DATOS PLAZA PROVEEDORES////
        formDetalleDatosPlazaDefaults: {
                autoParent:"layoutDetalleDatosPlaza",
                _constructor: "AtlasFormulario",
                dataSource:"atbatProveedoresDS",
                numCols:6,autoDraw:false,
                colWidths:[50,150,50,150,50,150],
                fields:        [
                        {name:"PRVD_ID", canEdit: false, showIf: "false", width:80},
                        {name:"IND_CERT_RESP_SUBS"},
                        {name:"FEC_DESDE_CERT_RESP", dateFormatter:"toEuropeanShortDatetime", useTextField:"true"},
                        {name:"FEC_HASTA_CERT_RESP", dateFormatter:"toEuropeanShortDatetime", useTextField:"true"}
            ]
        },
        formBotonesDetalleDatosPlazaDefaults: {
                autoParent:"layoutDetalleDatosPlaza",
                _constructor: "HLayout",
                autoDraw: false
        },
        botonFormDatosPlazaProveedorGrabarDefaults: {       
                autoParent: "formBotonesDetalleDatosPlaza",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formTabDatosPlazaBotonGrabar").title,
                autoDraw:false,
                click : function () {
                        // verificamos si el usuario puede registrar/actualizar los datos del formulario
                        // lo siguiente esta comentado en referencia a la pag. 11 del documento de especificaciones
                        // donde se dice que un usuario <> de CTR sólo puede modificar datos de ésta pestaña
                        /*if (!formDetalleDatosPlaza.isNewRecord()) {
                                if (UsuarioAutenticado.usuarioPuedeModificar("usuarioPuedeModificar")) {
                                        isc.warn("No tiene permisos para modicar el registro");
                                        return;
                                }
                        }*/
                        var modulo = this.creator;
                        if (this.creator.formDetalleDatosPlaza.valuesHaveChanged()) {
                                this.creator.formDetalleDatosPlaza.saveData(function(dsResponse, data) {
                                        if (dsResponse.status >= 0) {
                                                modulo.formDetalleDatosPlaza.clearCellHilites();
                                                modulo.formEdicionProveedores.clearCellHilites();
                                                modulo.formEdicionProveedores.clearValues();
                                                modulo.formDetalleDatosPlaza.clearValues();
                                                modulo.formEdicionProveedores.editRecord(data);
                                                modulo.formDetalleDatosPlaza.editRecord(data);
                                        }
                });
                        } else {
                                isc.say("No se realiz&oacute; ning&uacute;n cambio en los datos");
                        }
                }
        },
        botonFormDatosPlazaProveedorCancelarDefaults: {       
                autoParent: "formBotonesDetalleDatosPlaza",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formTabDatosPlazaBotonCancelar").title,
                autoDraw: false,
                click : function () {
                        this.creator.formDetalleDatosPlaza.reset();
                        this.creator.formDetalleDatosPlaza.clearErrors(true);
                        this.creator.formDetalleDatosPlaza.clearCellHilites();
                }
        },
        layoutDetalleDatosPlazaDefaults: {
                _constructor: "VLayout",
                layoutMargin:0,
                height:"100%",
                autoDraw: false
        },
        //////DETALLE VEHICULOS////
        grillaDetalleVehiculosDefaults: {
                autoParent:"layoutDetalleVehiculos",
                _constructor: "AtlasGrilla",
                dataSource:"atbatVehiculosDS",
                autoDraw: false,
                canEdit:false,
            createRecordComponent : function (record, colNum) { 
                var fieldName = this.getFieldName(colNum); 
                if (fieldName == "Acciones") { 
                        var modulo = this.creator;
                    var recordCanvas = isc.HLayout.create({
                        height: 22,
                        align: "left",
                        members: [
                                                isc.AtlasImgBoton.create({
                                                    src: Page.getAppImgDir()+"/AccesoForm.png",
                                                    prompt: "Acceso Form[Edit]",
                                                        click: function () {
                                                                if (modulo.grillaDetalleVehiculos.getSelectedRecord() != null) {
                                                                        modulo.cargarVehiculos(modulo.grillaDetalleVehiculos.getSelectedRecord().PRVD_ID,
                                                                                        modulo.grillaDetalleVehiculos.getSelectedRecord().VEHC_ID,
                                                                                        modulo.formEdicionProveedores.getValue("NOMBRE"),
                                                                                        modulo.grillaDetalleVehiculos.getSelectedRecord(), true);
                                                                }
                                                        }
                                                }),
                                                isc.AtlasImgBoton.create({
                                                    src: Page.getAppImgDir()+"/AccesoForm.png",
                                                    prompt: "Acceso Form",
                                                        click: function () {
                                                                if (modulo.grillaDetalleVehiculos.getSelectedRecord() != null) {
                                                                        modulo.cargarVehiculos(modulo.grillaDetalleVehiculos.getSelectedRecord().PRVD_ID,
                                                                                        modulo.grillaDetalleVehiculos.getSelectedRecord().VEHC_ID,
                                                                                        modulo.formEdicionProveedores.getValue("NOMBRE"),
                                                                                        modulo.grillaDetalleVehiculos.getSelectedRecord(), false);
                                                                }
                                                        }
                                                })
                        ]
                    });
                    return recordCanvas; 
                } else { 
                    return null; 
                } 
            },
        // TODOS LOS CAMPOS DEBEN LLEVAR ESTAS TRES PROPIEDADES
//                canFilter:false,        // Poner a false si es un campo que está en el buscador
//                canEdit: true,                // Poner a false si no se puede actualizar o se actualiza dinámicamente
//                showIf:"true"                // Poner a "false" si no se desea que se vea en el grid inicial pero si sale en las columnas utilizables
                fields: [
                        {name: "Acciones", title: " ", width: 30 , canEdit: false, canFilter: false, autoFreeze: true},
                        {name:"PLZS_ID", canFilter:true, canEdit: false, type:"ComboBox", showIf:"true"},
                        {name:"VEHC_ID",        canFilter:true,        canEdit: false, showIf:"true"},
                        {name:"MARCA", canFilter:true, canEdit: true, showIf:"true"},
                        {name:"TVHC_ID", canFilter:true, canEdit: true, showIf:"true"},
                        {name:"AGRUPACION", canFilter:true, canEdit: true, showIf:"true"},
                        {name:"TONELAJE", canFilter:true, canEdit: true,        showIf:"true"},
                        {name:"NIFCIF_PRVD_TARJETA", canFilter:true,        canEdit: true, showIf:"true"},
                        {name:"IND_ADR", canFilter: true, canEdit: true,        showIf:"true"},
                        {name:"IMPORTE_DTO",        canFilter:true,        canEdit: true, showIf:"true"},
                        {name:"FECHA_ALTA", width:80, canFilter:true, canEdit: false, showIf:"true"},
                        {name:"FECHA_BAJA", width:80, canFilter:true, canEdit: false, showIf:"true"},
                        {name:"ESTADO", width:60, canFilter:true, canEdit: false, showIf:"true"},
                        {name:"USER_ALTA", width:150, canFilter:true, showIf:"false"},
                        {name:"USER_MOD", width:150, canFilter:true, showIf:"false"},
                        {name:"FEC_ALTA", width:100, canFilter:true, showIf:"false"},
                        {name:"FEC_MOD", width:100, canFilter:true, showIf:"false"}
                ]
        },
        formDetalleVehiculosDefaults: {
                autoParent:"layoutDetalleVehiculos",
                _constructor: "HLayout",
                autoDraw: false
        },
        botonFormDetalleVehiculoFiltroDefaults: {
                autoParent: "formDetalleVehiculos",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formTabVehiculosBotonVerFiltro").title,
                autoDraw: false,
                click:  function () {
                        if (this.creator.grillaDetalleVehiculos.showFilterEditor == true) {
                                this.creator.grillaDetalleVehiculos.setShowFilterEditor(false);
                                this.setTitle(proveedoresUIDS.getField("proveedores.formTabVehiculosBotonVerFiltro").title);
                        } else {
                                this.creator.grillaDetalleVehiculos.setShowFilterEditor(true);
                                this.setTitle(proveedoresUIDS.getField("proveedores.formTabVehiculosBotonOcultarFiltro").title);
                        }
                }
        },
        botonFormDetalleVehiculoAccesoFormDefaults: {       
                autoParent: "formDetalleVehiculos",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formTabVehiculosBotonAccesoForm").title,
                autoDraw: false,
                click: function () {
                        if (this.creator.formEdicionProveedores.getValue("PRVD_ID") != null) {
                                this.creator.cargarVehiculos(this.creator.formEdicionProveedores.getValue("PRVD_ID"),
                                        null, this.creator.formEdicionProveedores.getValue("NOMBRE"), true);
                        }
                }
        },
        botonFormDetalleVehiculoExcelDefaults: {       
                autoParent: "formDetalleVehiculos",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formTabVehiculosBotonExcel").title,
                autoDraw: false,
                click: function () {
                        this.creator.grillaDetalleVehiculos.exportData({
                                exportAs: "csv",
                                exportDisplay: "download"
                        });
                }
        },
        layoutDetalleVehiculosDefaults: {
                _constructor: "VLayout",
                layoutMargin:0,
                height:"100%",
                autoDraw: false
        },
        layoutDetalleOtrasPlazasDefaults: {
                _constructor: "LayoutTabProvOtrasPlazas"       
        },
        grillaDetalleFormasDePagoDefaults: {
                autoParent:"layoutDetalleFormasDePago",
                _constructor: "AtlasGrilla",
                dataSource:"atbatTipoPagoProveedorDS",
                autoDraw: false,
                editEvent:"none",
            createRecordComponent : function (record, colNum) { 
                var fieldName = this.getFieldName(colNum); 
                if (fieldName == "Acciones") { 
                    var recordCanvas = null;
                    var modulo = this.creator;
                    if (UsuarioAutenticado.esUsuarioCTR()) {
                            recordCanvas = isc.BotonesParaEdicionesGrilla.create({
                                    _modulo : modulo,
                                    _grillaOrigen : modulo.grillaDetalleFormasDePago,
                                    _botonXEsconder : 3
                            });
                                    /*isc.HLayout.create({
                                height: 22,
                                align: "left",
                                members: [
                                                        isc.AtlasImgBoton.create({
                                                            src: Page.getAppImgDir()+"/grideditar.png",
                                                            prompt: "Editar",
                                                                click: function () {
                                                                        modulo.habilitarCamposEdicionGrillaFormasPago(false);
                                                                        modulo.grillaDetalleFormasDePago.startEditing(modulo.grillaDetalleFormasDePago.getEventRow());                                       
                                                            }
                                                        }),
                                                        isc.AtlasImgBoton.create({
                                                src: Page.getAppImgDir()+"/gridgrabar.png",
                                                prompt: "Grabar",
                                                                click: function () {
                                                                        modulo.grillaDetalleFormasDePago.endEditing();                                       
                                                }
                                            }),
                                            isc.AtlasImgBoton.create({
                                                src: Page.getAppImgDir()+"/gridcancelar.png",
                                                prompt: "Cancelar",
                                                                click: function () {
                                                                        modulo.grillaDetalleFormasDePago.cancelEditing();                                       
                                                }
                                            })
                                ]
                            });*/
                    }
                    return recordCanvas; 
                } else
                        { 
                    return null; 
                } 
            },
        // TODOS LOS CAMPOS DEBEN LLEVAR ESTAS TRES PROPIEDADES
//                canFilter:false,        // Poner a false si es un campo que está en el buscador
//                canEdit: true,                // Poner a false si no se puede actualizar o se actualiza dinámicamente
//                showIf:"true"                // Poner a "false" si no se desea que se vea en el grid inicial pero si sale en las columnas utilizables
                fields: [
                        {name: "Acciones", title: " ", width: 60, canFilter:false, canEdit: false, autoFreeze: true},
                        {name:"PRVD_ID", canFilter:true,        canEdit: false, showIf:"false"},
                        {
                                name:"TIPO_PAGO", canFilter:true, canEdit: false, showIf:"true", width:120,
                                optionDataSource:"atxxvTtpgDS",
                                valueField:"TTPG_ID", displayField:"TTPG_TEXTO", editorType:"ComboBoxItem"
                        },
                        {
                                name:"FDPG_ID",        canFilter:true,        canEdit: true, showIf:"true", width:140, optionDataSource:"atbatFormasPagoDS",
                                valueField:"FDPG_ID", displayField:"DESCR",        editorType:"ComboBoxItem"
                        },
                        {name:"DIAS_VENCIMIENTO1", canFilter:true, canEdit: true, showIf:"true"},
                        {name:"DIAS_VENCIMIENTO2", canFilter:true, canEdit: true, showIf:"true"},
                        {name:"DIAS_VENCIMIENTO3", canFilter:true, canEdit: true, showIf:"true"},
                        {name:"DIA_PAGO", canFilter:true, canEdit: true, showIf:"true"},
                        {name:"CCONTABLE", canFilter: true, canEdit: true, showIf:"true"},
                        {name:"CCPARTIDA", canFilter:true, canEdit: true, showIf:"true"},
                        {name:"USER_ALTA", width:150, canFilter:true, showIf:"false"},
                        {name:"USER_MOD", width:150, canFilter:true, showIf:"false"},
                        {name:"FEC_ALTA", width:100, canFilter:true,        showIf:"false"},
                        {name:"FEC_MOD", width:100, canFilter:true, showIf:"false"}
                ]
        },
        formBotonesDetalleFormasDePagoDefaults: {
                autoParent:"layoutDetalleFormasDePago",
                _constructor: "HLayout",
                autoDraw: false
        },
        botonFormFormasPagoProveedorNuevoDefaults: {       
                autoParent: "formBotonesDetalleFormasDePago",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formTabFormasPagoBotonNuevo").title,
                autoDraw: false,
                disabled : !UsuarioAutenticado.esUsuarioCTR(),
                click:  function () {
                        if (this.creator.formEdicionProveedores.getValue("PRVD_ID") == null) return;
                        this.creator.habilitarCamposEdicionGrillaFormasPago(true);
                        var newRecord = {
                                PRVD_ID : this.creator.formEdicionProveedores.getValue("PRVD_ID")
                        };
                        this.creator.grillaDetalleFormasDePago.startEditingNew (newRecord);
                }
        },
        botonFormFormasPagoProveedorFiltroDefaults: {       
                autoParent: "formBotonesDetalleFormasDePago",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formTabFormasPagoBotonVerFiltro").title,
                autoDraw: false,
                click:  function () {
                        if (this.creator.grillaDetalleFormasDePago.showFilterEditor == true) {       
                                this.creator.grillaDetalleFormasDePago.setShowFilterEditor(false);
                                this.setTitle(proveedoresUIDS.getField("proveedores.formTabFormasPagoBotonVerFiltro").title);
                        } else {
                                this.creator.grillaDetalleFormasDePago.setShowFilterEditor(true);
                                this.setTitle(proveedoresUIDS.getField("proveedores.formTabFormasPagoBotonOcultarFiltro").title);
                        }
                }
        },
        botonFormFormasPagoProveedorExcelDefaults: {       
                autoParent: "formBotonesDetalleFormasDePago",
                _constructor: "IButton",
                title: proveedoresUIDS.getField("proveedores.formTabFormasPagoBotonExcel").title,
                autoDraw: false,
                click: function () {
                        this.creator.grillaDetalleFormasDePago.exportData ({
                                exportAs: "csv",
                                exportDisplay: "download"
                        });
                }
        },
        layoutDetalleFormasDePagoDefaults: {
                _constructor: "VLayout",
                layoutMargin:0,
                height:"100%",
                autoDraw: false
        },
        tabProveedoresDetalleDefaults: {
                autoParent:"seccionForm",
                _constructor: "TabSet",
                autoDraw: false,
                margin:0,
                height: "100%",
            tabs: [
                {
                        pane:"autoChild:layoutDetalleDatosPlaza", idTab: "datosPlaza",
                        title:proveedoresUIDS.getField("proveedores.formTabTituloDatosPlaza").title,
                        width:100
                },
                {
                        pane:"autoChild:layoutDetalleVehiculos",idTab: "detalleVehiculos",
                        title:proveedoresUIDS.getField("proveedores.formTabTituloVehiculos").title,
                        width:100,
                        tabSelected : function (tabSet, tabNum, tabPane, ID, tab, name) {
                                var codProveedor = tabSet.creator.formEdicionProveedores.getValue("PRVD_ID");
                                    // recuperamos la información necesaria del fomulario de edición del proveedor
                                    var criteria= {
                                            PRVD_ID: codProveedor
                                    };
                                    tabSet.creator.grillaDetalleVehiculos.fetchData(criteria);
                        }
                },
                {
                        pane:"autoChild:layoutDetalleOtrasPlazas", idTab: "otrasPlazas",
                        title:proveedoresUIDS.getField("proveedores.formTabTituloOtrasPlazas").title,
                        width:100,
                        tabSelected : function (tabSet, tabNum, tabPane, ID, tab, name) {
                                var codProveedor = tabSet.creator.formEdicionProveedores.getValue("PRVD_ID");
                                    // recuperamos la información necesaria del fomulario de edición del proveedor
                                    var criteria= {
                                            PRVD_ID: codProveedor
                                    };
                                    this.creator.layoutDetalleOtrasPlazas.grillaDetalleOtrasPlazasDetail.fetchData(criteria);
                        }
                },
                {
                        pane:"autoChild:layoutDetalleFormasDePago", idTab: "formasDePago",
                        title:proveedoresUIDS.getField("proveedores.formTabTituloFormasPago").title,
                        width:100,
                        tabSelected : function (tabSet, tabNum, tabPane, ID, tab, name) {
                                var codProveedor = tabSet.creator.formEdicionProveedores.getValue("PRVD_ID");
                                    // recuperamos la información necesaria del fomulario de edición del proveedor
                                    var criteria= {
                                            PRVD_ID: codProveedor
                                    };
                                    this.creator.grillaDetalleFormasDePago.fetchData(criteria);
                        }
                }
            ]
        },
        seccionFormDefaults: {
                _constructor: "VLayout",
            width: "100%",height: "100%",autoDraw: false
        },
    seccionBuscadorDefaults: {
            _constructor: "SectionStack",
        visibilityMode: "multiple",
        width: "100%",autoDraw: false,// height: "100%",
        sections: [
            {
                title: proveedoresUIDS.getField("proveedores.tituloSeccionFiltro").title,
                width: "100%",items: ["autoChild:nivelBuscadorSeccionBuscador"]
            },
            {
                title: proveedoresUIDS.getField("proveedores.tituloSeccionGrillaResultados").title,
                width: "100%",items: ["autoChild:nivelResultadosSeccionBuscador"]
            }
        ]
    },
        nivelBuscadorSeccionBuscadorDefaults: {
                autoParent: "seccionBuscador",height:130,
                _constructor: "VLayout"
        },
        nivelResultadosSeccionBuscadorDefaults: {
                autoParent: "seccionBuscador",height:"100%",
                _constructor: "VLayout"
        },
    tabs: [
        {
                title: proveedoresUIDS.getField("proveedores.tabBuscador").title,
                icon: Page.getAppImgDir()+"/pestbusca.png", iconSize:16,
                pane:"autoChild:seccionBuscador",
                tabSelected : function (tabSet, tabNum, tabPane, ID, tab, name) {
                        if (formEdicionformularioProvee.valuesHaveChanged()) {
                                isc.warn("Valores sin guardar");
                                tabSet.selectTab(1);
                        }
                }
        },
        {
                title: proveedoresUIDS.getField("proveedores.tabForm").title,
                icon: Page.getAppImgDir()+"/pestform.png", iconSize:16,
                pane:"autoChild:seccionForm"
        }
    ],
    initWidget : function() {
            // En este caso, la llamada a super va primero por la necesidad de cargar widgets
            // luego de que el TabSet haya sido inicializado, de otra forma, esta llamada puede ir al
            // final
        this.Super("initWidget", arguments);
       
        this.addAutoChild("seccionBuscador");
       
        this.addAutoChild("nivelBuscadorSeccionBuscador");
        this.addAutoChild("nivelResultadosSeccionBuscador");

        this.addAutoChild("filtroProveedores");
        this.addAutoChild("botonesFiltroProveedores");
        this.addAutoChild("botonBuscarComoFiltroProveedor");
        this.addAutoChild("botonBuscarExactoFiltroProveedor");
        this.addAutoChild("botonLimpiarFiltroProveedor");
       
        this.addAutoChild("grillaProveedores");
       
        this.addAutoChild("botonesGrillaProveedores");
        this.addAutoChild("botonGrillaFiltroProveedor");
        this.addAutoChild("botonGrillaExcelProveedor");
        this.addAutoChild("botonGrillaInformeProveedor");
       
        this.addAutoChild("formEdicionProveedores");
       
        if (!UsuarioAutenticado.esUsuarioCTR()) this.formEdicionProveedores.setCanEdit(false);
       
        this.addAutoChild("formBotonesEdicionProveedores");
        this.addAutoChild("botonFormProveedorNuevo");
        this.addAutoChild("botonFormProveedorAnterior");
        this.addAutoChild("botonFormProveedorSig");
        this.addAutoChild("botonFormProveedorGrabar");
        this.addAutoChild("botonFormProveedorCancelar");
       
        this.addAutoChild("tabProveedoresDetalle");
       
        this.addAutoChild("formDetalleDatosPlaza");
       
        this.addAutoChild("formBotonesDetalleDatosPlaza");
        this.addAutoChild("botonFormDatosPlazaProveedorGrabar");
        this.addAutoChild("botonFormDatosPlazaProveedorCancelar");
       
        this.addAutoChild("grillaDetalleVehiculos");
       
        this.addAutoChild("formDetalleVehiculos");
        this.addAutoChild("botonFormDetalleVehiculoFiltro");
        this.addAutoChild("botonFormDetalleVehiculoAccesoForm");
        this.addAutoChild("botonFormDetalleVehiculoExcel");
       
        this.addAutoChild("grillaDetalleFormasDePago");
       
        this.addAutoChild("formBotonesDetalleFormasDePago");
        this.addAutoChild("botonFormFormasPagoProveedorNuevo");
        this.addAutoChild("botonFormFormasPagoProveedorFiltro");
        this.addAutoChild("botonFormFormasPagoProveedorExcel");
    }
       
});

Thanks in advance,

Viewing all articles
Browse latest Browse all 4756

Trending Articles