jQWidgets Forums

jQuery UI Widgets Forums General Discussions How to POST using php

Tagged: 

This topic contains 6 replies, has 2 voices, and was last updated by  eabarca 11 years ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • How to POST using php #57251

    eabarca
    Participant

    Hi again, i was wondering how to post data when i use php. I want to use php functions to validate, update and insert data, but dont know how to post data from jqWidgets. Thanks.-

    How to POST using php #57252

    Peter Stoev
    Keymaster

    Hi eabarca,

    This is demonstrated in the PHP Integration section in our Demo: http://www.jqwidgets.com/jquery-widgets-demo/

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    How to POST using php #57444

    eabarca
    Participant

    Thanks, accomplish it working with validator too, but I have a doubt as to the events that I can use, for example in http://api.jquery.com/category/events/ i found events using jquery but I have seen that the validator also accepts events as “ValueChanged”. Is there a list of events for use in validator? Thank you.-

    How to POST using php #57445

    Peter Stoev
    Keymaster

    Hi eabarca,

    It depends on whether the HTML Element or Widget supports a specific event. The list of events supported by the widgets can be found in the respective API Documentation pages. jqxValidator’s purpose is to listen to an event and validate.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    How to POST using php #57450

    eabarca
    Participant

    Thanks for the help, i got it work. Now im facing another problem.
    I have listado.php(jqxgrid listing patients and href with patient ID) and listado.js: http://jsfiddle.net/sqHPL/2/
    By clicking on link it opens carga_pacientes.php(form with patient data), carga_pacientes.js(jqx components logic): http://jsfiddle.net/t5J6a/
    And funciones.php, as content have functions that return json data for components, like this:

    function get_pacientes(){
    	global $conexion;
    	$result = $conexion->query(DB_QUERY_SELECT_PACIENTES);
    	$pacientes = array();
    	if($result && $result->num_rows >0) {
    		while($row = $result->fetch_assoc()) {
    			$fecha_nacimiento = $row['FechaNacimiento'] != null ? (new DateTime($row['FechaNacimiento']))->format('d/m/Y') : null;
    			$pacientes[] = array(
    							"IdPaciente" => $row['IdPaciente'],
    							"Apellido" => htmlentities($row['Apellido']),
    							"Nombre" => htmlentities($row['Nombre']),
    							"IdTipoDocumento" => htmlentities($row['IdTipoDocumento']),
    							"NroDocumento" => $row['NroDocumento'],
    							"FechaNacimiento" => $fecha_nacimiento
    							);
    		}
    	}
    	return json_encode($pacientes);
    }
    

    What i want to do is load data on carga_pacientes.php from DB when i click on href on jqxGrid. I use to do it using pure php before using jQuery, but now that i have to implement it i dont know how to load data on jqxcombobox, jqxdatetimeinput, …
    How to do it? Thanks for your time and help.

    How to POST using php #57466

    Peter Stoev
    Keymaster

    Hi eabarca,

    jqxComboBox’s data binding is the same as in jqxGrid – it uses jqxDataAdapter and you have to set the widget’s source property to point to the jqxDataAdapter’s instance. You also have to set the ComboBox’s displayMember and valueMember properties which specify the displayed text and the value of the item. jqxDateTimeInput does not support any type of binding and it is not necessary. To update its value, you can use its setDate or val methods. If you have DateTimeInput for range selection, use the setRange method instead. The expected argument there is a JavaScript Date object.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    How to POST using php #57483

    eabarca
    Participant

    I have done all that and php form(carga_pacientes.php) loads correctly with jqx components data, but what i want to do is clicking on jqxgrid link and open form and load data for a record on DB passed by param:

    $('#jqxgrid').jqxGrid(
    	{
    		.
    		.
    		.
    		columns: 
    		[{ text: '', cellsalign: 'center', columntype: 'link', width: 100, cellsrenderer: function (row, column, value) {
    		var rowID = $("#jqxgrid").jqxGrid('getrowid', row);
    		var value = $('#jqxgrid').jqxGrid('getcellvaluebyid', rowID, "IdPaciente");
    		return '<a href="carga_paciente.php?IdPaciente=' + value + '">CLICKEA</a>';}}]

    I need to execute a query with IdPaciente param and fill form & their jqx components with data for this particular Id.
    I hope ive been a little more clear about it, as my english isnt the best. Thanks again.-

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.