Forum Replies Created

Viewing 15 posts - 1 through 15 (of 59 total)
  • Author
    Posts
  • in reply to: grid handlekeyboardnavigation grid handlekeyboardnavigation #107669

    mustafa
    Participant

    hello
    i solved the problem above
    i couldn’t do I get the details of a row?

         handlekeyboardnavigation: function (event) {
                     
                    else if (event.ctrlKey && event.which === 68) { // ctrl+d 
                        event.preventDefault();
                   
                    }
                },

    mustafa
    Participant

    hello this try
    You need global variable datasource ( window.Datasource )

    
        function GridDynamicDataBind(grid, gridData, gridSource) {
    
            gridSource.localdata = gridData;
            $("#" + grid + "").jqxTreeGrid('updateBoundData');  
            $("#" + grid + "").jqxTreeGrid('refresh');
    
        }
    
        function TreeGridDynamicDataBind(grid, gridData, gridSource) {
    
            gridSource.localdata = gridData;
            $("#" + grid + "").jqxTreeGrid('updateBoundData');  
            $("#" + grid + "").jqxTreeGrid('updating');  
            $("#" + grid + "").jqxTreeGrid('endUpdate'); 
            $("#" + grid + "").jqxTreeGrid('refresh');
    
        }
    

    dynamic data bind

    STANDART GRID

    
    function GridInvoice() {
    var data = "";
        window.GridInvoiceDataSource =
    
              {
                  datafields: [
                  { name: 'InvoiceID', type: 'string' },
                  { name: 'Code', type: 'string' },
                  { name: 'InvoiceItemName', type: 'string' },
                  { name: 'VesselName', type: 'string' },
                  { name: 'InvoiceNo', type: 'string' } 
                      commit(true);
                  },
                  localdata: data,
                  async: false,
                  datatype: "array",
                  id: 'InvoiceID',
    
              }
    
        var dataAdapter = new $.jqx.dataAdapter(window.GridInvoiceDataSource);
    
        $("#GridInvoice").jqxGrid(
        {
            width: '100%',
            source: dataAdapter,
            pageable: true,
            columnsresize: true,
            enablehover: true,
            //autorowheight: true,
            sortable: true,
    
            altrows: true,
            height: '700px',
            pagesize: 30,
            theme: "web",
            editable: false,
            columns: [
                 { text: 'Item Code', datafield: 'Code', width: '7%', },
                 { text: 'Item Name', datafield: 'InvoiceItemName', width: '10%', },
                 { text: 'Vessel', datafield: 'VesselName', width: '10%' },
                 { text: 'Invoice No', datafield: 'InvoiceNo', width: '10%', }          
            ],
        });
    }
     
    function UpdateGridInvoice(updateData) {
     
            $.ajax({
    
                url: '/Invoice/UpdateInvoice/',
                type: 'POST',
                dataType: 'json',
                contentType: 'application/json; charset=utf-8',
                data: JSON.stringify({ updateData: updateData}),
                async: false, 
                success: function (status) {   
                    if (status) { 
                       var resultData = GetInvoices();
                       GridDynamicDataBind("GridInvoice", resultData, window.GridInvoiceDataSource); 
    
                    }
                    else alertify.error("UpdateInvoice");
    
                },
                error: function (jqXHR, textStatus, errorThrown) {
                    alertify.error("UpdateInvoice");
                }
            });
        }
    }
    
    

    TREEGRID

    
    function GridInvoiceItem() {
    
        var data = GetInvoiceItemsHierarchy();
        window.GridInvoiceItemDataSource =
             {
                 datafields: [
                 { name: 'InvoiceItemID', type: 'string' },
                 { name: 'ParentID', type: 'string' },
                 { name: 'Name', type: 'string' },
                 { name: 'Code', type: 'string' }
    
                 ], 
                 hierarchy:
            {
                keyDataField: { name: 'InvoiceItemID' },
                parentDataField: { name: 'ParentID' }
            },
                 localdata: data,
                 async: false,
                 datatype: "array",
                 id: 'InvoiceItemID',
    
             }
    
        var dataAdapter = new $.jqx.dataAdapter(window.GridInvoiceItemDataSource);
      
        $("#GridInvoiceItem").jqxTreeGrid(
        {
            width: '100%',
            height: '700px',
            source: dataAdapter,
            pageable: true,
            sortable: true, 
            pageSize: 200,
            theme: 'web',
            editable: false,
            columns: [
              { text: 'Name', datafield: 'Name', width: '50%', },
              { text: 'Code', datafield: 'Code', width: '50%', }
            ]
        });
    }
    
    function AddInvoiceItem(addData) {
     
            $.ajax({
                url: '/InvoiceItem/AddInvoiceItem/',
                type: 'POST',
                dataType: 'json',
                contentType: 'application/json; charset=utf-8',
                data: JSON.stringify({ incomingData: addData }),
                async: false,
                success: function (status) { 
                    if(status)
                   {   var resultData = GetInvoiceItems();
                       TreeGridDynamicDataBind("GridInvoiceItem", resultData, window.GridInvoiceItemDataSource); 
                    }
                    else {
                        DynamicAlertifyFunction('error', 'AddInvoiceItem');
                    }
                },
                error: function (e) {
                    DynamicAlertifyFunction('error', 'AddInvoiceItem');
                }
            });
        }
    }
    • This reply was modified 5 years ago by  mustafa.
    • This reply was modified 5 years ago by  mustafa.
    • This reply was modified 5 years ago by  mustafa.
    • This reply was modified 5 years ago by  mustafa.

    mustafa
    Participant

    hi dimitar
    There is a problem
    The first option comes down

      $("#dropListItemsForInvoice").jqxDropDownList({
            source: GetInvoiceItemsHierarchy(),
            promptText: "Select Item",
            displayMember: "Name",
            valueMember: "InvoiceItemID",
            height: "34px",
            width: "135%",
            dropDownHeight: 500, 
            dropDownWidth: 510,
            selectedIndex: 0, 
            dropDownHorizontalAlignment: 'left',
            theme: "web",
        });
    
        $("#dropListItemsForInvoice").jqxDropDownList('insertAt', { label: 'Select Item', value: 0 }, 0);

    thank you

    in reply to: category is not working filter category is not working filter #70300

    mustafa
    Participant

    thank you for reply dimitar

    in reply to: spreadsheet cell load data spreadsheet cell load data #67721

    mustafa
    Participant

    hi dimitar
    No need to answer the first question

    Ship names seems (headers)
    But the knowledge of each vessel does not appear
    example

    var sourceColumnsAB = [{ MasterID:1, VesselID : ‘1453’,StockKG: ’55’},{MasterID:2, VesselID : ‘1455’, StockKG: ’88’}];

    • This reply was modified 5 years, 3 months ago by  mustafa.
    • This reply was modified 5 years, 3 months ago by  mustafa.
    in reply to: spreadsheet cell load data spreadsheet cell load data #67719

    mustafa
    Participant

    2

    example bind data

    // renderer for grid cells.
        var numberrenderer = function (row, column, value) {
            return '<div style="text-align: center; margin-top: 5px;">' + (1 + value) + '</div>';
        }
        var sourceColumnsAB = [{ VesselID : '1',StockKG: '55'},{VesselID : '2', StockKG: '88'}];
    
        var vessels= GetVessels();
        var columns = [];
        var theme = "";
        for (var i = 0; i < vessels.length; i++) {
            var VesselName = vessels[i].Name;
            var VesselID = vessels[i].VesselID;
    
            if (i == 0) {
                var cssclass = 'jqx-widget-header';
                if (theme != '') cssclass += ' jqx-widget-header-' + "web";
                columns[columns.length] = { pinned: true, exportable: false, text: "", columntype: 'number', cellclassname: cssclass, cellsrenderer: numberrenderer };
            }
            datafields[datafields.length] = { name: VesselName, value: VesselID };
            columns[columns.length] = { text: VesselName, datafield: VesselID, width: 60, align: 'center' };
        }
    
        var source =
        {
          
            datafields: [
                        { name: 'StockKG', type: 'string' },
                        { name: 'VesselID', type: 'string' }
            ],
            localdata: sourceColumnsAB,
    
            
            updaterow: function (rowid, rowdata) {
                // synchronize with the server - send update command   
            }
        };
    
        var dataAdapter = new $.jqx.dataAdapter(source);
        $("#GridEstimation").jqxGrid(
               {
                   width: 850,
                   source: dataAdapter,
                   editable: true,
                   columnsresize: true,
                   selectionmode: 'multiplecellsadvanced',
                   columns: columns
               });
    }

    in reply to: spreadsheet cell load data spreadsheet cell load data #67715

    mustafa
    Participant

    hello dimitar
    I want to show you my problem step by step

    first 1

      var stocks= GetStocks();
          
        var numberrenderer = function (row, column, value) {
    
            return '<div margin-top: 5px;">' + (stocks[row].Name) + '</div>';
        }
    
    var theme = "";
                 var datafields = [];
                 var columns = [];
                 for (var i = 0; i < data.length; i++) {
                     var text = String.fromCharCode(65 + i);
          
                     if (i == 0) {
                         var cssclass = 'jqx-widget-header';
                         if (theme != '') cssclass += ' jqx-widget-header-' + theme;
                         columns[columns.length] = { pinned: true, exportable: false, text: "", columntype: 'number', cellclassname: cssclass, cellsrenderer: numberrenderer };
                     }
                     datafields[datafields.length] = { name: text };
                     columns[columns.length] = { text: text, datafield: text, width: 60, align: 'center' };


    All does not appear
    Which should I modified the css?

    • This reply was modified 5 years, 3 months ago by  mustafa.
    • This reply was modified 5 years, 3 months ago by  mustafa.
    • This reply was modified 5 years, 3 months ago by  mustafa.
    in reply to: spreadsheet cell load data spreadsheet cell load data #67688

    mustafa
    Participant

    and
    the data does not appear
    Where am I doing wrong?
    thank you

        // renderer for grid cells.
        var numberrenderer = function (row, column, value) {
            return '<div style="text-align: center; margin-top: 5px;">' + (1 + value) + '</div>';
        }
        var sourceColumnsAB = [{ VesselID : '1',StockKG: '55'},{VesselID : '2', StockKG: '88'}];
    
        var vessels= GetVessels();
        var columns = [];
        var theme = "";
        for (var i = 0; i < vessels.length; i++) {
            var VesselName = vessels[i].Name;
            var VesselID = vessels[i].VesselID;
    
            if (i == 0) {
                var cssclass = 'jqx-widget-header';
                if (theme != '') cssclass += ' jqx-widget-header-' + "web";
                columns[columns.length] = { pinned: true, exportable: false, text: "", columntype: 'number', cellclassname: cssclass, cellsrenderer: numberrenderer };
            }
            datafields[datafields.length] = { name: VesselName, value: VesselID };
            columns[columns.length] = { text: VesselName, datafield: VesselID, width: 60, align: 'center' };
        }
    
        var source =
        {
          
            datafields: [
                        { name: 'StockKG', type: 'string' },
                        { name: 'VesselID', type: 'string' }
            ],
            localdata: sourceColumnsAB,
    
            
            updaterow: function (rowid, rowdata) {
                // synchronize with the server - send update command   
            }
        };
    
        var dataAdapter = new $.jqx.dataAdapter(source);
        $("#GridEstimation").jqxGrid(
               {
                   width: 850,
                   source: dataAdapter,
                   editable: true,
                   columnsresize: true,
                   selectionmode: 'multiplecellsadvanced',
                   columns: columns
               });
    }
    • This reply was modified 5 years, 3 months ago by  mustafa.
    • This reply was modified 5 years, 3 months ago by  mustafa.
    in reply to: spreadsheet cell load data spreadsheet cell load data #67685

    mustafa
    Participant

    thanks

    • This reply was modified 5 years, 3 months ago by  mustafa.
    in reply to: spreadsheet cell load data spreadsheet cell load data #67676

    mustafa
    Participant

    hello dimitar thank you for reply I will test

    2.question

    my vessel list data

    [0]
       VesselID :    198
       VesselName :  OZAN4   
    
    [1]
       VesselID :    199
       VesselName :  ThunderBirth
    
    and 
    my stock list  data
    
    [0]
       StockID:    1
       StockName:  OIL   
    
    [1]
        StockID:    2
        StockName:  OIL2   
     


    I show left the stock names? and if possible I can stock Id ?

    and question

    3. this my user grid

    
        window.GridUserDataSource =
    
             {
                 datafields: [
                 { name: 'UserID', type: 'string' },
                 { name: 'Name', type: 'string' },
                 { name: 'Surname', type: 'string' },
                 { name: 'Email', type: 'string' },
                 { name: 'UserGroupName', type: 'string' },
                 { name: 'UserGroupID', type: 'string' },
                 { name: 'IsActive', type: 'bool' },
                 { name: 'Password', type: 'string' }
                 ],
                 addrow: function (rowid, rowdata, position, commit) {
                     commit(true);
                 },
                 deleterow: function (rowid, commit) {
                     commit(true);
                 },
                 updaterow: function (rowid, newdata, commit) {
                     commit(true);
                 },
                 localdata: GetUsers(),
                 async: false,
                 datatype: "array",
                 id: 'UserID',
    
             }
    
        var dataAdapter = new $.jqx.dataAdapter(window.GridUserDataSource,
            {
                formatData: function (data) {
                    data.name_startsWith = $("#searchField").val();
                    return data;
                }
            }
        );
         
        $("#GridUser").jqxGrid(
        {   width: '100%',
            source: dataAdapter,
           
            height: '700px',
            pagesize: 30,
            pagesizeoptions: [25, 50, 100],
            theme: "Web",
            editable: false,
            columns: [
              { text: 'Name', datafield: 'Name', width: '20%', },
              { text: 'Surname', datafield: 'Surname', width: '20%', },
              { text: 'Email', datafield: 'Email', width: '20%', },
              { text: 'User Group', datafield: 'UserGroupName', width: '20%' },
              { text: 'Active', datafield: 'IsActive', width: '20%', threestatecheckbox: false, columntype: 'checkbox' },
    
            ],
    
        });

    I want to get the data like this

    thank you very much

    in reply to: spreadsheet cell validation spreadsheet cell validation #67657

    mustafa
    Participant

    thank you dimitar

    in reply to: row mouseout event row mouseout event #67287

    mustafa
    Participant

    Hi peter
    Thank you for reply

    in reply to: grid in dropdownlist get value grid in dropdownlist get value #67087

    mustafa
    Participant

    hi dimitar
    thank you for reply
    good samples 🙂

    in reply to: bottom sum not showing bottom sum not showing #67080

    mustafa
    Participant

    hi dimitar
    than you for reply

    • This reply was modified 5 years, 3 months ago by  mustafa.
    in reply to: I can not filter I can not filter #67068

    mustafa
    Participant

    hello peter
    ok
    I’ll tell you more simple

    does not work in the dropdownlist popup window Focus has the problem
    I’m using bootstrap modal plugin
    example
    A similar problem
    http://www.jqwidgets.com/community/reply/reply-to-jqxgrid-bootstrap-3-2-0-modal-filtering-input-text-box-is-not-focusing-5/

    Where will I use this code ? Can you give full example?
    thank you

      $.fn.modal.Constructor.prototype.enforceFocus = function () {
                $(document)
                  .off('focusin.bs.modal') // guard against infinite focus loop
                  .on('focusin.bs.modal', $.proxy(function (e) {
                      if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
                          if ($(e.target).parents().hasClass('jqx-popup'))
                              return true;
                          this.$element.trigger('focus')
                      }
                  }, this));
            }
Viewing 15 posts - 1 through 15 (of 59 total)