Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SelectItem with multiple selection and filter

    Hi, I have a SelectItem with filter and multiple selection, I select ok multiple items, but when I apply a filter, lost the items previously select. Any idea?

    I use the next version of smartclient : SmartClient_SC_SNAPSHOT-2012-02-16_v82p

    and it works with mozilla

    And the source code is:

    {name:"listaSubproyectos", titleAlign:"left", title:isc.Mpxi18nProperties.subprojects, align:"left", width:300, multiple:true, editorType:"SelectItem", colSpan:4,
    autoFetchData: false,
    optionDataSource:"subprojectDS",
    optionFilterContext: {data: {pageSize: isc.MpxGeneralProperties.dataPageSize}},
    displayField:"codCompuestoSubproyecto", valueField:"id",
    pickListWidth:800,
    pickListProperties: {dataPageSize: isc.MpxGeneralProperties.dataPageSize, showFilterEditor: true, canResizeFields: true,
    filterByCell: false, filterOnKeypress: false,
    /**
    * Esta función hace falta porque necesitamos asegurarnos que si se usa algo del filtro
    * se añada siempre que el filtro que estipulamos por defecto
    * @param criteria el filtro a utilizar
    * @param callback la función a la que invocar
    * @param requestProperties las propiedades de la petición
    */
    filterData: function(criteria, callback, requestProperties) {
    var argumentsToPass = [];
    //obtenemos el filtro que se ha de ejecutar siempre unido a los criterios recibidos
    var filter = paymentConditionServiceAndContractDF.getItem("listaSubproyectos").getDefaultFilter(criteria);
    //creamos la lista de argumentos a pasar
    if (arguments.length == 0) {
    argumentsToPass[0] = filter;
    }
    else {
    argumentsToPass = [filter, callback, requestProperties];
    }
    this.Super("filterData", argumentsToPass);
    }
    },
    pickListFields:[
    {name: "codCompuestoSubproyecto", width: 80, title: isc.Mpxi18nProperties.code},
    {name: "descripcion"},
    {name: "codCliente", width: 50, dataPath: "cliente/codigoCliente", title: isc.Mpxi18nProperties.customer},
    {name: "codProyecto", width: 50, dataPath: "proyecto/codigoProyecto", title: isc.Mpxi18nProperties.project},
    {name: "codProducto", width: 50, dataPath: "producto/codigoEstructura", title: isc.Mpxi18nProperties.product},
    {name: "codLineaVenta", width: 80, dataPath: "lineaVenta/codigoEstructura", title: isc.Mpxi18nProperties.saleLine},
    {name: "codDelegacion", width: 60, dataPath: "delegacion/codigoProvincia", title: isc.Mpxi18nProperties.delegation},
    {name: "fechaInicio", width: 70, dateFormatter: "toEuropeanShortDate", canFilter: false},
    {name: "fechaFin", width: 60, dateFormatter: "toEuropeanShortDate", canFilter: false}
    ],
    getDefaultFilter: function(filter) {
    if (filter == undefined) {
    filter = {};
    }
    paymentConditionWin.addFilterCode(filter, "idsProductos", paymentConditionServiceAndContractDF.getItem("listaProductos").getValue());
    paymentConditionWin.addFilterCode(filter, "idsLineasVenta", paymentConditionServiceAndContractDF.getItem("listaLineasVenta").getValue());
    paymentConditionWin.addFilterCode(filter, "idsEmpresas", paymentConditionServiceAndContractDF.getItem("listaEmpresas").getValue());
    paymentConditionWin.addFilterCode(filter, "idsDelegaciones", paymentConditionServiceAndContractDF.getItem("listaDelegaciones").getValue());
    return filter;
    }
    }

    Thanks

    #2
    Anyone can help me please?

    I'm deseperated!

    Comment


      #3
      SelectItem with multiple selection and filter

      I have the same error. Have you find a solution? Thanks

      Comment

      Working...
      X