jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 46 through 60 (of 247 total)
  • Author
    Posts

  • Christopher
    Participant

    Hi AliMajed,

    Please provide a code sample so I can review it and come up with a solution.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi r.ammann@microtronic.ch,

    Unfortunately we are not able to reproduce the issue you’re experiencing. We tested the demo again in FireFox, Chrome, IE11 and EDGE and it works without any problems.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi nitinjambhale,

    $(args).jqxComboBox('addItem', args.value); The problem is that “args” isn’t valid. “args” doesn’t contain an instance of the jqxComboBox. You need to create a global variable for example “comboBoxInstance” and in the “createeditor” function assign the instance of the jqxComboBox to that variable, so you can later make a call to it in the cellendedit function. Here’s what i have in mind:

    
    var comboBoxInstance;
                $("#myGrid").jqxGrid {
                ...
                columns: [
                        {
                            text: 'Country', datafield: 'countryCode', displayfield: 'Country', columntype: 'combobox', editable: true,
                            createeditor: function (row, value, editor) {
                                editor.jqxComboBox({ source: countriesAdapter, displayMember: 'label', valueMember: 'value', multiSelect: true });
                                comboBoxInstance = editor;
                            },
                            ...
               }
    
    $("#myGrid").on('cellendedit', function (event) {
            var args = event.args;
            var columnDataField = args.datafield;
            var rowIndex = args.rowindex;
            var cellValue = args.value;
            var oldValue = args.oldvalue;
            
            comboBoxInstance.jqxComboBox('addItem', args.value);
            //$(comboBoxInstance).jqxComboBox('addItem', { label: args.value, value: '0' });
            $("#myGrid").jqxGrid('setcellvalue', "Pl", args.value);        
        });
    

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi walker1234,

    Yes you can apply a style ot any column depending on whatever value of the jqxGrid you like. The cellclassname should be set to the column that you want to apply color to. In that function you can check for other field’s values in other columns. For example, using the getrowdata function by passing the “row” number that you already have in the “cellclass” function, you can check every single value of the current row.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi nitinjambhale,

    New items are added as a source to the jqxComboBox. In a scenario where the jqxComboBox is used as a columtype for a column in a jqxGrid it uses the Grid’s source. You can also set a separate data source to the jqxComboBox if you like. Please provide a code sample so we can understand what exactly is the difficulty you’re facing.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi walker1234,

    Define the “wordInString” function somewhere in the beginning of your code( as a global function) and call it in your “cellclass” function to check if the value of the row contains the keyword you’re looking for. If it contains it, return the color you want to apply to that cell. For example:

    
    var cellclass = function (row, columnfield, value) {
    var flag = wordInString(value, 'you');
                    if (flag === true) {
                        return 'blue';
                    }
                }
    

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi mattcash,

    For your first question:
    We can allow the user to enter edit mode on any key pressed. This can be done through the handlekeyboardnavigation function of the jqxGrid, by calling the begincelledit method when a certain key is pressed.

    For the other question:
    The selectLast property of the jqxInput does exactly what it suggests. It sets the input mark at the end of the string in the jqxInput text box. Unfortunately it isn’t part of the API documentation.

    The selectLast function has been tested in all popular browsers and it works in all of them ( Safari, FireFox, IE, Chrome).

    I modified the code that you found on the other thread to work the way you want to. Here is a link to the demo:
    https://www.jseditor.io/?key=xb-jqxgrid-enter-edit-mode-on-key-pressed

    The demo has been tested on the latest versions of Chrome, FireFox, MS Edge, IE11 and it works perfectly on all of them.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi AliMajed,

    If you’ve applied the JSON correctly, the jqxTree automatically adds an id attrbiute to every “li” tag that corresponds to the ID from the JSON. So you can select a “li” element by the id you want, using the selectitem.
    This demo shows how to bind to JSON:
    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/treebindingtojson.htm?light
    This shows how to select the item:
    http://jsfiddle.net/jqwidgets/yWBZJ/

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi Marat,

    Thank you for the feedback. We will address this issue in a future release.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi SysProfile,

    You don’t have to add filteritmes to every column that doesn’t need it. You can just check if the datafield of the current column is the one you need – “Discontinued”. If it is, add the filteritems property to it. If not, don’t add it. You can make that check here:

    var aryColumns = new Array();
          for (var i = 0; i < objColumns.length; i++) {
            aryColumns.push({
              "datafield": objColumns[i].cmn_menu_webcfg_dfName, // The field name that I use in the query MySQL, the same as the previous case
              "columntype": objColumns[i].cmn_menu_webcfg_dfType, // 'textbox','dropdownlist','numberinput','checkbox' or 'datetimeinput'
              "text": objColumns[i].cmn_menu_webcfg_fields_dfText, // It contains the title text of column
              "filterable": $.parseJSON(objColumns[i].cmn_menu_webcfg_dfFiltrable), // true or false
              "sortable": $.parseJSON(objColumns[i].cmn_menu_webcfg_dfSorteable), // true or false
              "editable": $.parseJSON(objColumns[i].cmn_menu_webcfg_dfEditable), // true or false
              "groupable": $.parseJSON(objColumns[i].cmn_menu_webcfg_dfGroupable), // true or false
              "menu": $.parseJSON(objColumns[i].cmn_menu_webcfg_dfMenu), // true or false
              "exportable": $.parseJSON(objColumns[i].cmn_menu_webcfg_dfExportable), // true or false
              "cellsAlign": objColumns[i].cmn_menu_webcfg_fields_dfLCR, // cell align, 'left', 'center' or 'right'
              "align": objColumns[i].cmn_menu_webcfg_fields_dfColLCR, // column align, 'left', 'center' or 'right'
              "width": objColumns[i].cmn_menu_webcfg_fields_dfWidth, // column width in pixels
              "cellsFormat": objColumns[i].cmn_menu_webcfg_fields_dfOutFormat, // This is a character string, especially for the date format, in my case  'dd-mm-yyyy' format
              "hidden": $.parseJSON(objColumns[i].cmn_menu_webcfg_dfHidden) // true or false
            });
          }
    

    For example:
    if(objColumns[i].cmn_menu_webcfg_dfName=== 'Discontinued') ... add the filteritems property.

    Another approach is to iterate through the “aryColumns” array and add the filteritems property only to the “Discontinued” column.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi padma,

    Remove the pageable: true property of the jqxGrid, or set it to false and paging will be disabled. After doing it, when the first checkbox is clicked, all rows will be selected. If you want all of the checkboxes of all rows to be checked as well( not just selected rows), you have to iterate through all of the rows in the jqxGrid and change the state of each checkbox to “checked”.

    Here is a link to the updated demo:
    https://www.jseditor.io/?key=grid-select-on-current-page-1

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi takwaicheng,

    If you just want to change the selection(the actual value) of the jqxComboBox, you can do that by calling the selectItem method of the widget. If you just want to change the visible label of the item in the ComboBox, then you need to create a new source with datafields: ‘label’ – the new text you want to see as an option and ‘value’ – the field that has the value. Here’s how to do that:
    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/grid-list-filter-with-key-value-column.htm?light

    The demo shows how to do it with jqxDropDownList, but the same can be accomplished with a jqxComboBox.

    In future please post your questions in the corresponding section of the forum( in this case, the jqxComboBox section).

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi joffreyj,

    The selected values actually appear in the jqxComboBoxes, but the font is colored in white, so that’s why you don’t see them. There seems to be some style, probably a media-query that is setting the color of the font to white when the screen is shrinked and something isn’t applied properly in FireFox, so it seems. The same happens with the placeHolder. Check the CSS styles that are applied, that’s the root of the problem.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com

    in reply to: Newbie Question Newbie Question #88728

    Christopher
    Participant

    Hi Wigginst,

    The page is making two Ajax calls because you are using the autoBind: true property on the dataAdapter and then you are setting the dataAdapter again to the jqxListBox. You should remove the autobind from the jqxDataAdapter because it’s unnecessary. Please provide some data so we can test you code and see if there’s a problem. It shouldn’t be a problem to load the data using displayMember and valueMember from a JSON object. It doesn’t have to be a JavaScript array to do that.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com


    Christopher
    Participant

    Hi SysProfile,

    Have a look at this demo:
    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/grid-list-filter-with-key-value-column.htm?light

    You can create a new data source for the jqxDropDownList that has the fields:

     { value: "true", label: "Seleccionado" },
      { value: "false", label: "No seleccionado" }

    and pass it to the checkbox column’s filteritems property as a jqxdataAdapter object(just like in the demo). This will configure the filter exactly like you want to.
    I made you a demo, here you go:
    https://www.jseditor.io/?key=xb-grid

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 15 posts - 46 through 60 (of 247 total)