jQWidgets Forums
Forum Replies Created
-
Author
-
Hey Peter,
That’s what I was going to do. But I am not sure how to handle the formatData function.
I call the same php file and use the data:name (data:company), (data:status) to determine which sql to process.
How can I change parameter name. Here is the code:var dataAdapter = new $.jqx.dataAdapter ( { datatype: "json", datafields: [ { name: 'name'}, { name: 'id'} ], id: 'id', url: 'listdata.php' }, { autoBind: true, formatData: function (data) { data.company = query; return data; }, loadComplete: function (data) { if (data.length>0){ response($.map(data, function (item) { return { label: item.name, value: item.id } })); } } } );
Thanks again
EricKHey Peter,
I guess, I assumed it would load the data if I had the displayMember and valueMember defined.
So, yes I will need to have the loadComplete.I only wanted to create a shorter method to the process. Since, I will have up to 10 inputs on a form that will call a php.
Thanks again,
EricThanks Peter,
I was trying to create a shorter version.
Do I have to use the loadComplete function or can this be automatic?Eric
June 8, 2014 at 6:31 pm in reply to: Adding widgets in content area Adding widgets in content area #55564Hello again.
Quick question.
Can I use the 100% for both width and height when initializing nav bar?Thanks for all of your assistance.
EricKHowdy Dimitar,
I am new too jquery so please confirm. Will the following re-set the source?
$('#calendar').on('change viewChange', function (event) { date = event.args.date; if (event.type == 'change') { cdate = formatDate(date,'yyyy-MM-dd'); source.data = {actdate:cdate}; dataAdapter = new $.jqx.dataAdapter(source); $("#events").jqxListBox({ source: dataAdapter }); } });
Answered my question.
var gridEditorValue = function (row, cellValue, editor) {
var rv = editor.jqxDropDownList(‘getSelectedItem’);
if (row==8){
return {id:editor.val(),name:rv.label};
}else{
return editor.val();
}}
May 8, 2014 at 3:54 pm in reply to: phpdemos\server_side_grid_crud phpdemos\server_side_grid_crud #54219Hi Peter,
Last question regarding the On success.call commit(true,newRowID)
can I pass other fields or only the newRowID?
ex. commit(true,newRowID, field1, field2…)
May 8, 2014 at 12:46 pm in reply to: phpdemos\server_side_grid_crud phpdemos\server_side_grid_crud #54198Hi Peter,
Yes, I would implement that technique if it worked correctly. If you can give me an example of this working. I would use it.
I have your example which I modified to recreate the issue. How can I send it to you.Thanks,
EricMay 8, 2014 at 12:12 pm in reply to: phpdemos\server_side_grid_crud phpdemos\server_side_grid_crud #54194Hi everyone,
I have a solution to the problem. You will need to process the ajax call before the add row function.
Sample:$("#addrowbutton").bind('click', function () { //var rowscount = $("#jqxgrid").jqxGrid('getdatainformation').rowscount; //var datarow = generaterow(rowscount + 1); var data = "insert=true"; $.ajax({ dataType: 'json', url: 'datatest.php', data: data, cache: false, success: function (data, status, xhr) { // insert command is executed. $("#jqxgrid").jqxGrid('addrow', null, data); } }); });
Hopefully this will help with anyone trying to add a row and needs to capture a key value to pass back to the grid.
May 8, 2014 at 9:59 am in reply to: phpdemos\server_side_grid_crud phpdemos\server_side_grid_crud #54183Hi Peter,
There is something that is performing an auto count when the add row function is called. I have remarked that part of the code out in the index.php. When I perform the add row it fills the EmployeeID with the number 10.Here is the returning data from the data.php
[{“EmployeeID”:”12″,”FirstName”:”Peter”,”LastName”:”Stoev”,”Title”:”Keymaster”,”Address”:”123 Widget Street”,”City”:”New York”,”Country”:”USA”,”Notes”:”Widgets are awsome.”}]The add row function is return the row count as a data field.
The only reason I am trying to get someone to look at this closer is because I will be using the grid for everything I plan on designing. I have done alot of testing with the grid features and have found no problems. This is the only issue, I need to have resolved in order to move forward.
May 6, 2014 at 11:28 am in reply to: Add Row with returned db id – continued Add Row with returned db id – continued #54033Hi Peter,
Do we have an example of ajax php insert into a database that does not pass any data with the insert?If not I could send you the sample I have.
Eric
May 5, 2014 at 10:55 pm in reply to: Add Row with returned db id – continued Add Row with returned db id – continued #53993Hi Peter,
Ok, the information you provided was very helpful.Basically, the filter has no criteria entered. I open the grid with showfilters, the grid is blank with my filter headings.
Nothing is entered. I select the add function and the grid shows a new row.
The only data that is returned from the add function is the new record id (generated from the database) and the datafields which are blank.
The grid should now have a row with the id field populated with a number. I would have thought the new row now has the id when I select it does not.Does the grid update itself with the new data automatically or do I have to set each field manually?
I found out that the grid does not have to be in editmode from your example above.From your examples which shows the data fields being populated before the add row is processed and your use of the generatedata.
One other question?
If the grid is filtered. Does that have an effect on the add row process? -
AuthorPosts