Hi Guys,
I’ve been using CodeIgniter for some time but I’m new to DHTMLX and in particular the Connector library. I could only find one page in the docs about it (are there any others apart from docs.dhtmlx.com/doku.php?id=tuto … eigniter&s[]=codeigniter?)
Anyway, I used the Contact example from the Getting Started Guide and ported that to Code Igniter and that is all working fine as it is quite a simple app. Now I want to do something more complex, like return a result set from two tables and display it in the dhtmlxGrid and then allow the dhtmlxGrid to inline edit the values.
My controller looks like this, hasn’t changed much from the example and works fine for one table. I’m not sure how to change it:
[code]<?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’);
require_once(“dhtmlx/connector/grid_connector.php”);
require_once(“dhtmlx/connector/db_phpci.php”);
DataProcessor::$action_param =“dhx_editor_status”;
class Contacts extends CI_Controller {
public function index()
{
$this->load->view('contacts');
}
public function get_urls()
{
$this->load->database();
$connector = new GridConnector($this->db, "phpCI");
$connector->configure("tblurl_custom", "id", "domain, path");
$connector->render();
}
}[/code]
If I wasn’t using the phpCI interface I understand I could use render_sql() to perform a more complex query, but this does not seem to be available via phpCI. I saw in the docs you can create a model and use methods like get() and get_value() but wasn’t sure if this was the right approach.
Another question is should I even be using the Connector and DataProcessor with CodeIgniter, is this best practice ?
Any help on how this pieces together would be much appreciated.
Thanks,
Tim