jQWidgets Forums

jQuery UI Widgets Forums Search Search Results for 'dataadapter'

Viewing 15 results - 1,801 through 1,815 (of 7,748 total)
  • Author
    Search Results
  • #88632

    junior
    Participant

    hi Hristo,
    sorry, i cannot relate this demo into angular 2 with typescript.
    please can you show me an actual script using angular 2 with typescript? since you are trying to integrate your product to angular 2 can you show how? like angular_jqxtree, json external file as a source data, angular_jqxdataAdapter, and dataBind inside a component. whats the purpose if you still introducing your javascript example in fact we are talking about angular 2 here. please answer me using an angular 2 way.

    thanks.

    #88622

    Ivo Zhulev
    Participant

    takwaicheng
    Participant

    Hi,
    How can I change the text of jqxcombobox in its Status Bar?

    renderstatusbar: function (statusbar) {
    var combo = $(“<div style=’font-size: 12px; font-family: Verdana;float: left; margin-top: 1px; margin-left: 4px;’ id=’combocity’></div>”);
    container.append(combo);
    statusbar.append(container);
    var source = new Array();
    var city = ‘SLC’;
    var cityid = ‘1’;
    source[0] = { city: city, cityid: cityid };
    var city = ‘LAX’;
    var cityid = ‘2’;
    source[1] = { city: city, cityid: cityid };
    var dataAdapter = new $.jqx.dataAdapter(source, { async: false });
    combo.jqxComboBox({selectedIndex: 0, source: dataAdapter, displayMember: “city”, valueMember: “cityid”, width: 65, height: 25});
    }

    $(“#changeCombo”).on(‘click’, function (event) {
    document.getElementById(‘combocity’).value = ‘LAX’;
    });

    #88607

    junior
    Participant

    hi peter,

    anybody here using angular_jqxtree, angular_jqxdataAdapter with JSON external file inside a class?
    please let me know.

    if no one, please peter can you show how?

    #88606

    junior
    Participant

    how to use external json file angular_jqxdataAdapter and angular_jqxtree inside a class?

    #88605

    junior
    Participant

    angular 2 integration is not ready? i did not see angular_jqxdataAdapter functionality, json with angular_jqxTree running on the demo.

    #88603

    In reply to: multilevel json tree


    junior
    Participant

    how create a dynamic tree using angular_jqxdataAdapter, JSON, dataBind, getrecordshierarchy?

    #88595

    junior
    Participant

    please help

    dear sir,
    can you show how to use angular_jqxdataAdapter, JSON source of data , dataBind() and getRecordsHierarchy?

    please help

    #88557

    Jerry Penguin
    Participant

    Hi Dimitar,

    I have found a solution:

    
    			var dataAdapter = new $.jqx.dataAdapter(source, 
    				{
    					beforeLoadComplete: function (records) {
    						for (var i = 0; i < records.length; i++) {
    							var _AnzTage	= Math.round(DateDiff(records[i]['Datum_von'], records[i]['Datum_bis'], "d")) + 1;
    							records[i]['AnzTage'] = _AnzTage;
    							//console.log("AnzTage1=" + _AnzTage);
    							//console.log("AnzTage2=" + records[i]['AnzTage']);
    							var _TagesVerbrauch	= records[i]['Verbrauch'] / _AnzTage;
    							records[i]['TagesVerbrauch'] = _TagesVerbrauch;
    							//console.log("TagesVerbrauch1=" + _TagesVerbrauch);
    							//console.log("TagesVerbrauch2=" + records[i]['TagesVerbrauch']);
    						}
    					}
    				}
    			);
    

    It works fine, I can sort the columns and I can use the build in cellsformat in columns with my localization objects.

    Thanks and have a nice weekend

    Greetings Jörn

    #88556

    Jerry Penguin
    Participant

    Hi Dimitar,

    Thanks for the quick reply, it works, I have built the following function:

    
    Ready: function () {
    	Var rows = $ ( '# jqxGrid') jqxGrid ( 'getrows');
    	For (var i = 0; i <rows.length; i ++) {
    	Var _AnzTage = Math.round (DateDiff (rows [i] .Date_from, rows [i] .Date_bis, "d")) + 1;
    		$ ( '# JqxGrid'). JqxGrid ( 'setcellvalue', i, 'days', _daysdays);
    		//Console.log ( "AnzTage =" + _AnzTage);
    	}
    },
    

    But I have now the problem that for each line I use the method setcellvalue the “updaterow” function of my source object is called and an update is written to the MySQL database.

    Now my question:
    Can I define a function in the source object that calculates a field while reading the JSON data?
    I have neither found a method in the API of jqxGrid nor in the jqxDataAdapter API such as “selectrow”, since there is a way, such as:

    
    datafields: [
    	{ name: 'ZigID' },
    	{ name: 'Datum_von', type: 'date' },
    	{ name: 'Datum_bis', type: 'date' },
    	{ name: 'Verbrauch' },
    	{ name: 'AnzTage' },
    	{ name: 'TagesVerbrauch' = 'Verbrauch' / 'AnzTage'}
    

    Thanks in advance

    Greetings Jörn

    #88548

    Topic: Grid Row editing

    in forum Grid

    shyan
    Participant

    Hello,

    I am trying to create a new row with the button click event as column type is checkbox, I am unable to create the checkbox while creating new row.

    `function getDataComplete(data) {
    if (data) {
    var source =
    { datatype: “array”,
    datafields: [
    { name: ‘code’, type: ‘string’ },
    { name: ‘number’, type: ‘string’ },
    { name: ‘work’, type: ‘boolean’ },
    { name: ‘primary’, type: ‘boolean’ }
    ],
    localdata: data
    };

    var dataAdapter = new $.jqx.dataAdapter(source);

    $scope.GridSettings =
    {
    altrows: true,
    width: 1100,
    autoheight: true,
    rendertoolbar: function (toolbar) {
    var container = $(“<div style=’margin: 5px;’></div>”);
    var submitButton = $(“<button style=’margin-right: 5px;’>Add Phone Number</button>”);
    toolbar.append(container);
    container.append(submitButton);
    submitButton.click(function (event) {

    var row = {code: null, number: null,work: true, primary: true };

    var commit = $(“#jqxgrid1”).jqxGrid(‘addrow’, null, row, ‘last’);

    var rows = $(‘#jqxgrid1’).jqxGrid(‘getrows’);
    });
    },
    sortable: true,
    pageable: true,
    selectionmode: ‘none’,
    editmode: ‘selectedrow’,
    source: dataAdapter,
    editable: true,
    showToolbar: true,
    columns: [
    { text: ‘Country Code’, columntype: ‘textbox’, datafield: ‘code’, width: 100},
    { text: ‘Primary’, columntype: ‘checkbox’, datafield: ‘work’, width: 100 },
    { text: ‘Fax’, columntype: ‘checkbox’, datafield: ‘primary’, width: 100 },
    {
    text: ‘Action’, filterable: false, align: “center”, editable: false, sortable: false, datafield: ”, width: 300,
    cellsrenderer: function (row, column, value) {
    var eventNam = “ng-click”;

    if ((row === $scope.editrow) && $scope.out === false) {
    return “<button ” + eventNam + “=’updateGrid(” + row + “, $event)’style=’color: inherit; margin-left: 40%; left: -15px; top: 7px; position: relative;width:80px’ data-row='” + row + “‘>Update</button><button ” + eventNam + “=’Cancel(” + row + “, $event)’ style=’margin-left: 5px; left: -15px; top: 7px; position: relative;width:80px ‘ data-row='” + row + “‘>Cancel</button>”;
    }
    else {
    if (row === $scope.lastRow) {

    return “<button ” + eventNam + “=’Save(” + row + “, $event)’ style=’margin-left: 40%; left: -15px; top: 7px; position: relative;width:80px ‘ data-row='” + row + “‘>Save</button>” +
    “<button ” + eventNam + “=’Delete(” + row + “, $event)’ style=’margin-left: 5px; left: -15px; top: 7px; position: relative;width:80px ‘ data-row='” + row + “‘>Cancel</button>”;
    } else {
    debugger;

    return “<button ” + eventNam + “=’editGrid(” + row + “, $event)’ style=’color: inherit; margin-left: 40%; left: -15px; top: 7px; position: relative;width:80px’ data-row='” + row + “‘ class=’editButtons’>Edit</button>” +
    “<button ” + eventNam + “=’Delete(” + row + “, $event)’ style=’margin-left: 5px; left: -15px; top: 7px; position: relative;width:80px ‘ data-row='” + row + “‘>Delete</button>”;
    }}
    }}
    ]};

    #88542

    badera
    Participant

    Dear Hristo

    Well, with “refresh” I do mean reassign new data, not only redraw the grid. So if you look in my code abouve, I already do what you advised me: “Create a new source with a new DataAdapter and set to the TreeGrid”. Ok, this example assigns again the same data. In reality, the records would be different.
    So why does the code fail? In my opinion, I do exactly what you advice me. Whats wrong?

    #88541

    Hristo
    Participant

    Hello badera,

    If you would like to refresh the TreeGrid you could use this approach $scope.treeGridSettings.apply('refresh');.
    I would like to suggest this article, could be useful.
    In case you want to change the data source, could try to create a new source with new DataAdapter and set to the TreeGrid.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    #88534

    Christopher
    Participant

    Hi alastairwalker,

    Why don’t you just assign it to a global variable so you can use it later? If you cant use the jqxdataAdapter, then you need to format the date using JavaScript operations.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com

    #88531

    alastairwalker
    Participant

    It was a good idea until I tried to use in my own context.

    The ‘problem’ with the jqxdataAdapter is that it is not associated with a selector. The consequence of this is that it cannot be selected/used outside of its immediate context of instantiation.

    In simple terms, if it was created in a function somewhere, and you need to access the adapter in a different context (i.e. function) – it cannot be done.

    Unless I am missing something?

    Alastair

Viewing 15 results - 1,801 through 1,815 (of 7,748 total)