jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts

  • Marina
    Participant

    I tried to call ‘refresh’ method before and i tried to set width and height as you suggested and it did not help.
    I must clarify actually that shifting only happening for checkboxes and if i inspect element in chrome i can see that margin-top set to -5, so checkbox appears pushed up. Any other ideas how to fix it? I don’t see any errors in console.
    thanks,
    Marina


    Marina
    Participant

    I actually recreated this issue in more simple page, but its still happening when ids of the items in both trees have the same values. If ids are different its seems working fine.

    
    <script type="text/javascript">
    
                    function movetreeviewitems(source, destination) {
                        var sourceItems = $(source).jqxTree('getCheckedItems');
                        var destinationitems = $(destination).jqxTree('getItems');
                        var bfoundparent = false;
                      
                        var assigneditemsparent;
    
                        var destinationItemsMaxID = 0;
                        for (var n = 0; n < destinationitems.length; n++) {//loop through assigned elements to find max id
                            if (Number(destinationitems[n].id) > Number(destinationItemsMaxID)) {
                                destinationItemsMaxID = Number(destinationitems[n].id);
                            }
                        }
                        mainloop:
                        for (var i = 0; i < sourceItems.length; i++) {
                            var item = sourceItems[i];
                            if (item.level > 0) {
                                destinationitems = $(destination).jqxTree('getItems');
    
                                console.log("item", item);
                                console.log("item parent element", item.parentElement);
                                console.log("parent item", $(source).jqxTree('getItem', item.parentElement));
    
                                bfoundparent = false;
    
                                var itemcompanyid, itemcategoryid, categoryelement, companyelement, categoryitem, companyitem, itemelement;
                                itemelement = item.element;
    
                                if (!bfoundparent) {
                                    loopassigned:
                                    for (var j = 0; j < destinationitems.length; j++) {//loop through assigned elements to see if parents there
                                        if (destinationitems[j].level == 0 &&
                                            destinationitems[j].label == $(source).jqxTree('getItem', item.parentElement).label &&
                                            destinationitems[j].value == $(source).jqxTree('getItem', item.parentElement).value) {
                                            assigneditemsparent = destinationitems[j].element;
                                            console.log("ASSIGNED ITEM PARENT ELEMENT", assigneditemsparent);
                                            bfoundparent = true;
                                            break loopassigned;
                                        }
                                    }
                                }
                                console.log("foundparent", bfoundparent);
                                if (bfoundparent) {
                                    destinationItemsMaxID = destinationItemsMaxID + 1;
                                    console.log("ADD DISPATCHER ITEM");
                                    var lbl = item.label;
                                    var val = item.value;
                                    $(destination).jqxTree('addTo', { label: item.label, value: item.value, id: destinationItemsMaxID }, assigneditemsparent);
                                }
    
                                $(source).jqxTree('removeItem', itemelement);
                            }
                        }
    
                    }
    
                    $(document).ready(function () {
                        var data1 = [
                    { "id": "2",
                        "parentid": "1",
                        "text": "Hot Chocolate",
                        "value": "$2.3"
                    }, {
                        "id": "3",
                        "parentid": "1",
                        "text": "Peppermint Hot Chocolate",
                        "value": "$2.3"
                    }, {
                        "id": "4",
                        "parentid": "1",
                        "text": "Salted Caramel Hot Chocolate",
                        "value": "$2.3"
                    }, {
                        "id": "5",
                        "parentid": "1",
                        "text": "White Hot Chocolate",
                        "value": "$2.3"
                    }, {
                        "text": "Chocolate Beverage",
                        "id": "1",
                        "parentid": "-1",
                        "value": "0"
                    }
                    ]
    
                        var data2 = [
                   {
                       "id": "1",
                        "value": "0",
                       "text": "Chocolate Beverage",
                       "parentid": "-1"
                   }, {
                       "id": "2",
                       "text": "Caffe Vanilla Frappuccino",
                       "parentid": "1",
                       "value": "$2.3"
                   },  {
                       "id": "3",
                       "text": "Caffe Vanilla Frappuccino Light",
                       "parentid": "1",
                       "value": "$2.3"
                   }]
    
                        // prepare the data
                        var source1 =
                    {
                        datatype: "json",
                        datafields: [
                            { name: 'id' },
                            { name: 'parentid' },
                            { name: 'text' },
                            { name: 'value' }
                        ],
                        id: 'id',
                        localdata: data1
                    };
                        var source2 =
                    {
                        datatype: "json",
                        datafields: [
                            { name: 'id' },
                            { name: 'parentid' },
                            { name: 'text' },
                            { name: 'value' }
                        ],
                        id: 'id',
                        localdata: data2
                    };
    
                        var dataAdapter1 = new $.jqx.dataAdapter(source1);
                        dataAdapter1.dataBind();
                        var records1 = dataAdapter1.getRecordsHierarchy('id', 'parentid', 'items', [{ name: 'text', map: 'label'}]);
    
                        var dataAdapter2 = new $.jqx.dataAdapter(source2);
                        dataAdapter2.dataBind();
                        var records2 = dataAdapter2.getRecordsHierarchy('id', 'parentid', 'items', [{ name: 'text', map: 'label'}]);
    
                        $('#jqxTree1').jqxTree({ height: '400px', hasThreeStates: true, checkboxes: true, width: '330px', source: records1 });
                        $('#jqxTree1').css('visibility', 'visible');
                        $('#jqxTree2').jqxTree({ height: '400px', hasThreeStates: true, checkboxes: true, width: '330px', source: records2 });
                        $('#jqxTree2').css('visibility', 'visible');
    
                        $("#btnAssign").jqxButton({ width: 120, height: 40 });
                        $("#btnAssign").on('click', function () {
                            movetreeviewitems('#jqxTree1', '#jqxTree2');
                        });
    
                        $("#btnUnAssign").jqxButton({ width: 120, height: 40});
                        $("#btnUnAssign").on('click', function () {
                            movetreeviewitems('#jqxTree2', '#jqxTree1');
                        });
    
                    });
            </script>
    
    
    
         <table>
         <tr>
            <td> <div id='jqxTree1'></div></td>
            <td> 
            <input type="button" style='margin-top: 20px;'  value="Assign >>" id='btnAssign' />
            <input type="button" style='margin-top: 20px;'  value="UnAssign <<" id='btnUnAssign' />
            </td>
            <td> <div id='jqxTree2'></div></td>
         </tr>
         </table>
          
    in reply to: binding to label in form binding to label in form #107770

    Marina
    Participant

    can someone answer if type label can be bound to values at all?


    Marina
    Participant

    cool, that worked!

    in reply to: Edit row with checkbox column Edit row with checkbox column #102531

    Marina
    Participant

    i solved it by checking if rowselected on cellbeginedit of checkbox column , if not i return false and not allow to editing. still not sure why checkbox column behaving like that.


    Marina
    Participant

    How dynamically to hide buttons on some rows based on row data? I have implemented delete button, but i need to show it only on rows with specific data for some properties of the datarecord of this row.

    in reply to: Export to Excel not working Export to Excel not working #98603

    Marina
    Participant

    is latest version working right for export grid data to exel. I guess i get latest in october and we just realized before our release that this feature got broken.
    We have secure web site(https) and the version from october 2017 is not working. I’m getting error(no other code changes were done for that page).


    Marina
    Participant

    Marina
    Participant

    Thanks,
    but I don’t think keypress firing in that case at all.


    Marina
    Participant

    Nevermind I solved it by returning false in above code.

    in reply to: Limit date range to 2 days Limit date range to 2 days #85012

    Marina
    Participant

    Hi,
    I understand how to set min and max, but what I meant is ability for user select only two days range. Like if he picked 5/9/16 as start of range the end of range can only be 5/10/16 and if he picked 6/7/16 as start of range, then the end of range should only be allowed to pick 6/8/16 or no end date meaning that range is one day only. Like I want to set min/max dynamically on click of start date of range. Is it possible?

    in reply to: Headerless jqxWindows Headerless jqxWindows #84320

    Marina
    Participant

    Hi,
    No I wanted just small (30X30) resize icon always to be on top layer of map in right comer. I don’t need to drug it – only clicking event. I figured it out actually myself – had to set style properties of window content overflow to hidden.

    
         #jqxResizeMap .jqx-window-header, #jqxResizeMap .jqx-widget-header {
            display:none !important;padding:0px;  margin:0px; height:0; overflow: hidden;
        }
         #jqxResizeMap .jqx-window-content , #jqxResizeMap .jqx-widget-content 
         {
         	padding:0px;  margin:0px; overflow: hidden; 
         }
    
    in reply to: Headerless jqxWindows Headerless jqxWindows #84244

    Marina
    Participant
    in reply to: Headerless jqxWindows Headerless jqxWindows #84243

    Marina
    Participant

    Hello,
    I want header less window with only one icon inside to be the same size as window. I can’t get icon to occupy whole window if icon dimensions the same as window dimensions.
    Here is code in fiddle:

    Thanks,


    Marina
    Participant
Viewing 15 posts - 1 through 15 (of 24 total)