jQWidgets Forums

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: Date format Date format #27143

    benitocas88
    Member

    Hi, i work with jqxgrid and specific property cellsformat, if I set ‘d’, this returns a format date. then I change ‘f1’ but the problem is if I type 8.99, automatically rounding 9 and don’t like this, not like rounding! Is possible deactivate rounding?

    in reply to: showvalidationpopup showvalidationpopup #26521

    benitocas88
    Member

    It’s possible remove “showvalidationpopup” when a cell are validate equals true and the others remain showing while are false?

    in reply to: Gird and pagechanged fails Gird and pagechanged fails #15840

    benitocas88
    Member

    amazing, jquery 1.8.3 fix my problem on the whole and on the grouping, the only thing that I solved was the “search toolbar” but it does not matter much but I would like to work.
    Thank you very much!

    in reply to: Gird and pagechanged fails Gird and pagechanged fails #15828

    benitocas88
    Member

    Of course, this is that js code:
    (using jqx 2.7, works the last jquery and jquery ui, the modal show with jquery modal dialog, not jqxwindow)
    same function “toolbar” not works!, and if the page change not take the real value jqxcheckbox, only when clicked…

    var source = {
    datatype:'json',
    datafields:
    [
    {name: 'num_reg', type:'int'},
    {name: 'escuela'},
    {name: 'turno'},
    {name: 'zona_escolar'},
    {name: 'cct'},
    {name: 'chk', type: 'bool'}
    ],
    url: 'cnn.php',
    type:'POST',
    data:{
    opt:'cct_turno',
    niv_escolar:nivel_escolar,
    idperfil: id_perfil,
    unidad_regional: unidad_regional,
    modalidad: modalidad,
    zona_escolar: zona_escolar
    }
    };
    var dataAdapter_tunos = new $.jqx.dataAdapter(source,{
    loadcomplete:function(records){
    if (records != null)
    return records;
    },
    loadError: function (xhr, status, error){
    alert('Ocurrió un error al intentar recuperar la información.\nActualice la página e intente de nuevo.');
    },
    formatData: function(data){
    data.name_startsWith = $('#searchfield').val();
    //alert(data.name_startsWith);
    return data;
    }
    });
    var columnCheckBox = null;
    var updatingCheckState = false;
    $('#grid-cct-turno').jqxGrid({
    width: 753, source: dataAdapter_tunos, theme: 'ui-lightness', autoheight: true,
    editable: true, selectionmode: 'singlerow', sortable: false, pageable: true, altrows:true,
    rendered:function(){
    var length = dataAdapter_tunos.records.length;
    for(var x=0; x<length; x++)
    {
    // $("#grid-cct-turno").jqxGrid('setcellvalue', x, 'chk', false, false);
    var value_cct_grid = $('#grid-cct-turno').jqxGrid('getcellvalue',x,'cct');
    $.each(array_cct, function(index,valueArray){
    if(value_cct_grid == valueArray)
    $("#grid-cct-turno").jqxGrid('setcellvalue',x, 'chk', true, false);
    });
    }
    },
    ready: function(){
    var localizationobj = {};
    localizationobj.pagergotopagestring = 'Página';
    localizationobj.pagershowrowsstring = 'Agrupar en:';
    localizationobj.pagerrangestring = ' de ';
    $('#grid-cct-turno').jqxGrid('localizestrings', localizationobj);
    },
    columns:
    [
    {text:'No.', datafield:'num_reg', width:30, editable:false, cellsalign:'center'},
    {text:'Escuela', datafield: 'escuela', width:433, editable: false},
    {text: 'Turno', datafield:'turno', width:130, editable: false},
    {text:'Zona Escolar', datafield:'zona_escolar', width: 80, editable: false},
    {text:'CCT', datafield:'cct', width:110, editable: false, hidden:true},
    {text:'Seleccionar', datafield:'chk', width:80, columntype: 'checkbox', editable:true }
    ],
    showtoolbar: true,
    rendertoolbar: function (toolbar){
    var me = this;
    var container = $("<div style='margin: 5px;'></div>");
    var span = $("<span style:'float:left; margin-top:5px; margin-right: 4px;'>Buscar por escuela o CCT:</span>");
    var input = $("<input class='jqx-input' jqx-widget-content jqx-rc-all' id='searchfield' type='text' style='height: 23px; float:left; width:223px' />");
    toolbar.append(container);
    container.append(span);
    container.append(input);
    input.addClass('jqx-widget-content-ui-lightness');
    input.addClass('jqx-rc-all-ui-lightness');
    input.on('keydown', function (event){
    if (input.val().length >= 2) {
    if (me.timer) clearTimeout(me.timer);
    me.timer = setTimeout(function () {
    dataAdapter_tunos.dataBind();
    }, 300);
    }
    });
    }
    });//Finaliza el grid-cct-turno y todas sus configuraciones
    $("#grid-cct-turno").on("pagechanged", function (event) {
    //code here?
    });

    that is the html code:

    <div id="modal-cct-turno" title="Usted está en el módulo CCT y Turno">
    <div id="grid-cct-turno"></div>
    </div>

    and that is the php code:

    public function f_select_cct_turno($unidad_regional, $nivel_escolar, $modalidad, $zona_escolar, $idperfil)
    {
    $query = "CALL pa_selecciona_criterios_escuelas($unidad_regional,'$nivel_escolar','$modalidad','$zona_escolar',$idperfil);";
    $result = mysqli_query($this->connected, $query);
    mysqli_next_result($this->connected);
    $no_reg = 1;
    if(mysqli_num_rows($result)>0)
    {
    while($rows = mysqli_fetch_object($result))
    {
    $dts[] = array(
    'num_reg' => $no_reg,
    'escuela' => $rows->escuela,
    'turno' => $rows -> d_turno,
    'zona_escolar' => $rows -> zonaescola,
    'cct' => $rows -> cct,
    'chk' => false);
    $no_reg++;
    }
    echo json_encode($dts);
    }
    $this->closeConexion();
    }

    benitocas88
    Member

    Thanks dimitar, I see my error, maybe. When I draw the grid, use this code:
    Specific function=> rendered:function(){for(……)}

    pageable: true,
    groupable: true,
    rendered: function(){
    var length = dataAdapter.records.length;
    for(var x=0; x<length; x++)
    { //the check is indeterminated and this set false value
    $("#grid-grupos").jqxGrid('setcellvalue', x, 'chk', false, false);
    }
    },
    columns:...

    Here, do assing the value false because if I not do it, the values charge null or indeterminated. This works perfectly, I mean the event check or unchecked works in one or more rows.

    The problem comes when I group the column, apparently becomes static, check or uncheck not works, anything checkbox. But if remove the last code obviously(rendered) the value there check’s are null and if I group, YES check or unchecked works!!!.

    The question is:
    I need there values check’s are false the first time when load but when I grouping I can modify there’s values one or more rows, not necessary check or unchecked all… Thanks!!!

    I try to be the most specific possible…

Viewing 5 posts - 1 through 5 (of 5 total)