jQWidgets Forums
Forum Replies Created
-
Author
-
March 5, 2015 at 12:50 am in reply to: get variable value from dataadapter get variable value from dataadapter #68047
Thanks it work perfectly
February 24, 2015 at 2:01 am in reply to: Updating grid row and saving to mysql Updating grid row and saving to mysql #67538Thanks will take a look and let you know
January 25, 2015 at 4:19 am in reply to: Date rangeselection is offsetted by one day Date rangeselection is offsetted by one day #65970sorry there was a typo error in my previous post
page code source is like this:
$(document).ready(function () { // Create a jqxDateTimeInput $("#date").jqxDateTimeInput({width: "250px", height: "25px", theme: "Arctic", formatString: "yyyy-MM-dd", selectionMode: "range", showFooter: true, todayString: "Aujourd'hui"}); $("#date").jqxDateTimeInput('setRange', "2015-01-15", "2015-01-17"); $("#date").on('change', function (event) { var selection = $("#date").jqxDateTimeInput('getRange'); document.getElementById('debut').value = selection.from.toLocaleDateString(); document.getElementById('fin').value = selection.to.toLocaleDateString(); }); });
date range passed to the calendar is ok but it is offsetted by on day in the calendar field
December 30, 2014 at 2:58 am in reply to: php bug while sending dynamic data via json php bug while sending dynamic data via json #64807Now that it’s working what should I do if the mysql result is empty
does it cause an error with json_encode or should I send something else in order to not crash on the java sideDecember 30, 2014 at 2:47 am in reply to: php bug while sending dynamic data via json php bug while sending dynamic data via json #64805I’ve found the solution
while($r = mysql_fetch_assoc($result)) {
$resultat[] = $r;
}
echo json_encode($resultat);very simple, in case other need to know
Thank you
December 29, 2014 at 11:50 pm in reply to: multiple dataAdapter in one page multiple dataAdapter in one page #64802Ok, do I need to give a different var name and source name for each one like
var dataAdapter = new $.jqx.dataAdapter(Source);
var dataAdapter2 = new $.jqx.dataAdapter(Source2);so they can have a different behavior if needed ?
and to activate them I just need to include them in a event driven function to togle them on/off ?
Thanks,
December 28, 2014 at 9:23 pm in reply to: generic php search engine generic php search engine #64744Ok sorry but I’ve finally found that the bug was in my php script sending a bad json encoded data
but I still don’t know how to solve it. So I<ve moved my question to the dataAdapter section.
The scrip is working if I’m sending back a know number of mysql table field data. But I need to have a php script that can handle a variable number of mysql table field data to send back via json_encoded.
fixed number of data field work great but trying to handle a variable number of field data do not work and send corrupted json data.
see my post in data Adapter sectionThanks
December 28, 2014 at 3:31 pm in reply to: generic php search engine generic php search engine #64741OK now it work I can send request to the engine and get data back with the possibility to filter data on demand. My problem now is the data I<m getting back from the search engine do not show up in the dropdown list. It look like the number of item in the dropdown list is correct but I only get blanck item in the list
the data I get back is in this state:
[[“nom=>Yvan Perreault et Fils qc Inc.,nocli=>227-1”],[“nom=>Yvan Perreault et Fils Inc.,nocli=>227”],[“nom=>…..
…..,[“nom=>john doe,nocli=>612”]]my code is like this in the index.php:
var url = “../engine/index.php”;
// prepare the data
var source =
{
datatype: “json”,
type: “POST”,
datafields: [
{ name: ‘nocli’ },
{ name: ‘nom’ }
],
url: url,
async: false,
data: {
select: true,
dbase: “client”,
nbfield: 2,
numrow: “*”,
filtre: “-“,
ordre: “nom desc”,
field: [‘nom’, ‘nocli’]
}
};
var dataAdapter = new $.jqx.dataAdapter(source);
// Create a jqxDropDownList
$(“#jqxWidget”).jqxDropDownList({
selectedIndex: 0, source: dataAdapter, displayMember: “nom”, valueMember: “nocli”, width: 200, height: 25
});
$(“#jqxWidget”).jqxDropDownList({placeHolder: “Choisir:”});
// subscribe to the select event.
$(“#jqxWidget”).on(‘select’, function (event) {
if (event.args) {
var item = event.args.item;
if (item) {
var valueelement = $(“<div></div>”);
valueelement.text(“Value: ” + item.value);
var labelelement = $(“<div></div>”);
labelelement.text(“Label: ” + item.label);
$(“#selectionlog”).children().remove();
$(“#selectionlog”).append(labelelement);
$(“#selectionlog”).append(valueelement);
}
}
});something should be missing to have the data showing up in my dropdown list
-
AuthorPosts