Forum Replies Created

Viewing 15 posts - 1 through 15 (of 55 total)
  • Author
    Posts
  • in reply to: remote search remote search #46568

    damc
    Participant

    Hello Dimitar,

    And how can I load this item (Is there some function which can I use from code and have same functionality like search function which is called when the user types into the ComboBox’s input field)?

    Thanks,
    Damc


    damc
    Participant

    Hi Peter,

    I have changed my code:

    $("#jqxComboBox").on('keydown', function (event) {
    if (event.keyCode == 8 || event.keyCode == 46) {
    $("#jqxComboBox").jqxComboBox('clearSelection');
    }
    });

    This also doesn’t work. Combo still selects first item.

    Best regards,
    Damc


    damc
    Participant

    Hi Peter,

    With multiple grids (bellow in test case 2) on page with editable on true and selectionmode on singlecell, users have problems with selected item. If user jumps between grids cells with mouse and edits or deletes some values in some cases by editing or deleting value for example on first grid can happen that value on second grid is edited or deleted (because there are selected cell on first and on second). If we could clear selection, I think that would be this problem solved.

    You can make a test for example on column sales1 last row and column sale2 first row by changing values (repeatedly with mouse jumps from one to another and change values).

    My code:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <title id='Description'>This example shows how to integrate jqxGrid using jqxDataAdapter with Knockout.js.
    </title>
    <link rel="stylesheet" href="./2.6.1/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="./jquery-1.9.0.min.js"></script>
    <script type="text/javascript" src="./json2-2012-10-08.min.js"></script>
    <script type="text/javascript" src="./knockout-2.2.1.js"></script>
    <script type="text/javascript" src="./knockout.mapping-2.3.5.js"></script>
    <script type="text/javascript" src="./2.8.3/jqxcore.js"></script>
    <script type="text/javascript" src="./2.8.3/jqxdata.js"></script>
    <script type="text/javascript" src="./2.8.3/jqxbuttons.js"></script>
    <script type="text/javascript" src="./2.8.3/jqxscrollbar.js"></script>
    <script type="text/javascript" src="./2.8.3/jqxmenu.js"></script>
    <script type="text/javascript" src="./2.8.3/jqxgrid.js"></script>
    <script type="text/javascript" src="./2.8.3/jqxgrid.selection.js"></script>
    <script type="text/javascript" src="./2.8.3/jqxgrid.edit.js"></script>
    <script type="text/javascript" src="./2.8.3/jqxknockout.js"></script>
    <script type="text/javascript" src="./2.8.3/jqxcheckbox.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    //var initialData = [];
    var initialData = [
    { name: "Well-Travelled Kitten", sales: 352, price: 75.95 },
    { name: "Speedy Coyote", sales: 89, price: 190.00 },
    { name: "Furious Lizard", sales: 152, price: 25.00 },
    { name: "Indifferent Monkey", sales: 1, price: 99.95 },
    { name: "Brooding Dragon", sales: 0, price: 6350 },
    { name: "Ingenious Tadpole", sales: 39450, price: 0.35 },
    { name: "Optimistic Snail", sales: 420, price: 1.50 }
    ];
    var initialData1 = [
    { name1: "Audi", sales2: 35},
    { name1: "BMW", sales2: 34},
    { name1: "Mercedes", sales2: 33},
    { name1: "Opel", sales2: 12},
    ];
    var GridModel = function (items) {
    this.items = ko.mapping.fromJS(items);
    this.disabled = ko.observable(false);
    this.addItem = function () {
    // add a new item.
    if (this.items().length < 20) {
    this.items.push({ name: ko.observable(null), sales: ko.observable(null), price: ko.observable(null) });
    //this.items.push({ name: 'New item', sales: 100, price: 200 });
    }
    };
    this.removeItem = function () {
    // remove the last item.
    this.items.pop();
    };
    this.updateItem = function () {
    // update the first item.
    var item = {};
    item.name = ko.observable('name');
    item.sales = ko.observable(500);
    item.price = ko.observable(200);
    this.items.replace(this.items()[0], item);
    };
    };
    var GridModel1 = function (items1) {
    this.items1 = ko.mapping.fromJS(items1);
    };
    var model = new GridModel(initialData);
    var source = {
    localdata: model.items,
    datatype: 'observablearray'
    }
    var model1 = new GridModel(initialData1);
    var source1 = {
    localdata: model1.items,
    datatype: 'observablearray'
    }
    var dataAdapter1 = new $.jqx.dataAdapter(source);
    $("#jqxGrid1").jqxGrid({
    autoheight: true,
    source: dataAdapter1,
    editable: true,
    selectionmode: 'singlecell',
    columns: [
    { text: 'Name1', dataField: 'name', width: 200 },
    { text: 'Sales1', dataField: 'sales', width: 200, cellsalign: 'right' },
    { text: 'Price1', dataField: 'price', width: 200, cellsformat: 'c2', cellsalign: 'right' }
    ]
    });
    var dataAdapter2 = new $.jqx.dataAdapter(source1);
    $("#jqxGrid2").jqxGrid({
    autoheight: true,
    source: dataAdapter2,
    editable: true,
    selectionmode: 'singlecell',
    columns: [
    { text: 'Name2', dataField: 'name1', width: 200 },
    { text: 'Sales2', dataField: 'sales2', width: 200, cellsalign: 'right' },
    ]
    });
    ko.applyBindings(model);
    });
    </script>
    </head>
    <body class='default'>
    <div id='jqxWidget'>
    <div style="margin-bottom: 10px;">
    <input id="addButton" type="button" data-bind="click: addItem, jqxButton: {}" value="Add Item" />
    <input id="removeButton" type="button" data-bind="click: removeItem, jqxButton: {}" value="Remove Item" />
    <input id="updateButton" type="button" data-bind="click: updateItem, jqxButton: {}" value="Update Item" />
    <div data-bind="jqxCheckBox: {checked: disabled}" style='margin-top: 5px;' id="checkBox">Disabled</div>
    </div>
    <div data-bind="jqxGrid1: {disabled: disabled}" id="jqxGrid1">
    </div>
    </br>
    <div data-bind="jqxGrid2: {disabled: disabled}" id="jqxGrid2">
    </div>
    </div>
    </body>
    </html>

    damc
    Participant

    Hi Peter,

    On unselect event I have already try this command $(“#jqxComboBox”).jqxComboBox(‘clearSelection’) and this $(“#jqxComboBox”).jqxComboBox(‘selectIndex’, -1 ) and all three together:

    $("#jqxComboBox").jqxComboBox('clearSelection') ;
    $("#jqxComboBox").jqxComboBox('selectIndex', -1 );
    $(“#jqxComboBox”).val(”);

    It is steel the same problem like I wrote it.

    Best regards,
    Damc


    damc
    Participant

    Hi Peter,

    I would like to clear value in combo when user delete text with BACKSPACE or DELETE key.

    My code:
    On unselect event I set value with jQuery’s val: $(“#jqxComboBox”).val(”). If I have autoComplete = false then this code sets combo’s value to empty. If I have autoComplete = true then doesn’t work because combo sets value on first element.

    I debug code and found difference in args object
    $(“#jqxComboBox”).on(‘select’, function (event) {
    var args = event.args;

    1. autocomplete = false -> index = -1:
    args: Object
    index: -1
    item: null
    owner: a.jqx.define.b.(anonymous function)
    type: “none”
    __proto__: Object

    2. autoComplete = true -> index = 0
    args: Object
    index: 0
    item: Object
    owner: b.(anonymous function)
    type: “none”
    __proto__: Object

    Thank you for your help.


    damc
    Participant

    Hi Peter,

    Can you help me.

    If is it autoComplete on, I have problem with setting value on empty. How to implement, that user can delete value on combo and is autocomplete on?

    Thank you.


    damc
    Participant

    Hi Peter,

    I checked events in jqxGrid documentation and it seems that no one is apropriate. I tested with jQuery’s focusout event and is not working.

    How to implement clearselection?

    Best regards,
    Damc


    damc
    Participant

    Hi Peter,

    Which event can be used to call clearselection? I test with endcelledit and is not OK.

    Best regards,

    Damc


    damc
    Participant

    Hi Peter,

    On unselect event I set value with jQuery’s val: $(“#jqxComboBox”).val(”). This works.

    If I have turn on autoComplete then does not work. Combo set’s value on first element. Can you help me?

    Thank you!


    damc
    Participant

    Hi Peter,

    Item 2.
    What about to use event unselect and there set value to null?

    Thank you for your answer.

    in reply to: grid with number columns grid with number columns #21348

    damc
    Participant

    Hi Peter,

    It works fine!

    Thank you for your answer!

    Damc

    in reply to: jqxComboBox with Knockout jqxComboBox with Knockout #21334

    damc
    Participant

    Hi,

    I tested select event and there was a problem with param1, param2 and param3 – values were undefined. Can you help me? Which event to use that works with knockout (when user changes value is make a call of the function which returns some data on user inteface)

    Thank you for your help.

    in reply to: grid with number columns grid with number columns #21202

    damc
    Participant

    Hi Peter,

    This was not my question. I am sorry for bad explanation of problem.
    My question is: if it is possible to implement “Del” key functionality on mouse right click (like sample with Context Menu)?

    Thank you for your answer!

    Damc

    in reply to: grid with number columns grid with number columns #21186

    damc
    Participant

    Hi Peter!

    Is it possible to implement “Del” key action on Context Menu action like sample for edit and delete selected row. Users would like to have action for delete selected cell value on right click?

    Best Regards,

    Damc

    in reply to: grid with number columns grid with number columns #18951

    damc
    Participant

    Peter,

    Thank you for your answer. I miss in sample functionality that quantity or price can be empty (user must have option to clear cell not only to put on zero. Zero is in mine case like 1 – it is data).

    Is it possible to clear price or quantity cell?

    Best Regards,
    Damc

Viewing 15 posts - 1 through 15 (of 55 total)