jQWidgets Forums
jQuery UI Widgets › Forums › Search › Search Results for 'dataadapter'
-
AuthorSearch Results
-
October 31, 2016 at 3:10 pm #88632
In reply to: nobodys talking about angular_jqxtree
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.
October 31, 2016 at 12:18 pm #88622In reply to: Angular 2 Final version (Not Beta)
Hi junior,
Please use the jquery based jqxDataAdapter:
http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxdataadapter/index.htm#demos/jqxdataadapter/defaultfunctionality.htmBest Regards,
IvojQWidgets Team
http://www.jqwidgets.com/October 31, 2016 at 1:29 am #88608Hi,
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’;
});October 30, 2016 at 5:10 pm #88607Topic: nobodys talking about angular_jqxtree
in forum Treehi 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?
October 30, 2016 at 5:01 pm #88606Topic: how to use angular_jqxdataadapter
in forum Data Adapterhow to use external json file angular_jqxdataAdapter and angular_jqxtree inside a class?
October 30, 2016 at 4:54 pm #88605Topic: angular_jqxdataAdapter
in forum Data Adapterangular 2 integration is not ready? i did not see angular_jqxdataAdapter functionality, json with angular_jqxTree running on the demo.
October 30, 2016 at 7:58 am #88603In reply to: multilevel json tree
how create a dynamic tree using angular_jqxdataAdapter, JSON, dataBind, getrecordshierarchy?
October 28, 2016 at 5:38 pm #88595In reply to: Angular 2 Final version (Not Beta)
please help
dear sir,
can you show how to use angular_jqxdataAdapter, JSON source of data , dataBind() and getRecordsHierarchy?please help
October 28, 2016 at 5:29 am #88557In reply to: Computed Column that will sort and use the cellclass
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
October 28, 2016 at 4:29 am #88556In reply to: Computed Column that will sort and use the cellclass
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
October 27, 2016 at 6:52 pm #88548Topic: Grid Row editing
in forum GridHello,
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>”;
}}
}}
]};October 27, 2016 at 1:18 pm #88542In reply to: Reassign Data to jqxTreeGrid
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?October 27, 2016 at 12:45 pm #88541In reply to: Reassign Data to jqxTreeGrid
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 HristovjQWidgets team
http://www.jqwidgets.comOctober 27, 2016 at 8:35 am #88534In reply to: Getting the correct date format using 'getrowdata'
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,
ChristopherjQWidgets Team
http://www.jqwidgets.comOctober 27, 2016 at 7:53 am #88531In reply to: Getting the correct date format using 'getrowdata'
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
-
AuthorSearch Results