tbathiago / jquery-datatables-editable

Automatically exported from code.google.com/p/jquery-datatables-editable
0 stars 0 forks source link

New Example with Enhanced Functionality #36

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Just thought I'd post here for now, but here is an example of using this plugin:

http://www.modeltraintracker.com/sandbox/

Login with username 'testuser' and password 'testuser'.  Then you can see how 
you can add/modify/delete entries.  The popup window for editing is custom code 
that I wrote on top of the plugin. 

This works and looks best in Firefox.

Original issue reported on code.google.com by dmol...@gmail.com on 28 Jun 2011 at 1:05

GoogleCodeExporter commented 9 years ago

Original comment by joc...@gmail.com on 22 Sep 2011 at 8:49

GoogleCodeExporter commented 9 years ago
Thank you Dariush for your 'modeltraintracker'-example! I used it for a project 
of mine and everything works fine, except for one thing: filling the 'add-form' 
with your 'form.php'-file (I don't know what the code on that page is doing...).
Would you be so kind to give an example of form.php too?
Thank you,
Harrie

Original comment by haro...@gmail.com on 7 Jun 2012 at 2:36

GoogleCodeExporter commented 9 years ago
Here is form.php:

<?php

    require_once('auth.php');

    require_once('config.php');
    //Connect to mysql server
    $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
    if(!$link) {
        die('Failed to connect to server: ' . mysql_error());
    }

    //Select database
    $db = mysql_select_db(DB_DATABASE);
    if(!$db) {
        die("Unable to select database");
    }
?>      
            <br />      
            <div class="error" style="display:none;">
              <img src="css/images/important.gif" alt="Warning!" width="24" height="24" style="float:left; margin: -5px 10px 0px 0px; " />
              <span></span>.<br clear="all" />
            </div>          
            <label for="scale">Scale:</label><br />
            <select name="scale" id="scale">
                <option value="" />
            <?php
                $s_result = mysql_query('SELECT s_id, s_scale FROM scale ORDER BY s_scale');
                while($s_row = mysql_fetch_row($s_result)) {
                    echo "<option value=\"$s_row[0]\">".$s_row[1]."</option>";
                }
            ?>
            </select>
            <br />
            <label for="manufacturer">Manufacturer:</label><br />
            <select name="manufacturer" id="manufacturer">
                <option value="" />
                <?php
                    $m_result = mysql_query('SELECT m_index, m_name FROM manufacturer ORDER BY m_name');
                    while($m_row = mysql_fetch_row($m_result)) {
                        echo "<option value=\"$m_row[0]\">".$m_row[1]."</option>"; 
                    }
                ?>
            </select>  <div id="addManPopup" style="display:inline;" class="addPopup">Not listed?</div>
            <br />
            <label for="partnumber">Part Number:</label><br />
            <input name="partnumber" type="text" id="partnumber" value=""/> or <input name="partnumber" id="partnumbercbx" type="checkbox" value="unk" />Unknown
            <br />
            <label for="roadname">Road Name:</label><br />
            <select name="roadname" id="roadname">
                <option value="" />
                <?php
                    $r_result = mysql_query('SELECT r_index, r_roadname FROM roadnames ORDER BY r_roadname');
                    while($r_row = mysql_fetch_row($r_result)) {
                        echo "<option value=\"$r_row[0]\">".$r_row[1]."</option>"; 
                    }
                ?>              
            </select>  <div id="addRoadPopup" style="display:inline;" class="addPopup">Not listed?</div>
            <br />
            <label for="type">Type:</label><br />
            <select name="type" id="type">
                <option value="" />
                <?php
                    $t_result = mysql_query('SELECT t_index, t_type FROM type ORDER BY t_type');
                    while($t_row = mysql_fetch_row($t_result)) {
                        echo "<option value=\"$t_row[0]\">".$t_row[1]."</option>"; 
                    }
                ?>              
            </select>  <div id="addTypePopup" style="display:inline;" class="addPopup">Not listed?</div>
            <br />
            <label for="roadnumber">Road Number:</label><br />
            <input name="roadnumber" type="text" id="roadnumber" value=""/> or <input name="roadnumber" type="checkbox" value="n/a" id="roadnumbercbx"  />N/A
            <br />
            <label for="description">Description:</label><br />
            <input name="description" type="text" id="description" value="" size="30" maxlength="50" />
            <br />
            <label for="value">MSRP / current value (nearest dollar):</label><br />
            <input name="value" type="text" id="value" value="" size="10" />
            <br />
            <input type="hidden" name="ref" value="item" />

Original comment by dmol...@gmail.com on 7 Jun 2012 at 5:27

GoogleCodeExporter commented 9 years ago
Thank you again. I see that you're only using form.php to fill the <option>'s 
in the <select>'s from the database. That's complicating things (i.e. your 
jquery-script on the mainpage)a bit for me, because I just need a form with 
simple <input>'s. But I'll see what I can do.
Greetings,
Harrie

Original comment by haro...@gmail.com on 7 Jun 2012 at 7:58

GoogleCodeExporter commented 9 years ago
There is a bug in your jquery-code (on 
http://www.modeltraintracker.com/sandbox/items.php), Dariush: when you click 
"Edit selected item" right AFTER you have clicked "Add new item" (en closed 
that form with "Ok" or "Cancel") then the edit-form is empty! 
I'll try to solve this myself, but maybe you know sooner where and why the 
error occurs?
Harrie

Original comment by haro...@gmail.com on 9 Jun 2012 at 1:45

GoogleCodeExporter commented 9 years ago
Hello ! Great job ! 

Which librairies did you use for pdf saving ? 

Thanx

Original comment by k.mouham...@gmail.com on 16 Jul 2012 at 5:47

GoogleCodeExporter commented 9 years ago
Thanks, I use TCPDF.  

Original comment by dmol...@gmail.com on 16 Jul 2012 at 6:10

GoogleCodeExporter commented 9 years ago
Re Comment #5 - I've seen this problem before, and try as I might, I have not 
been able to pin it down to anything. It doesn't happen all the time, but it 
does happen enough for me to notice it. 

Original comment by dmol...@gmail.com on 16 Jul 2012 at 6:11

GoogleCodeExporter commented 9 years ago
I have download your ModeltrainTracker application but i didnt see Mysql dump 
database... where i can download it ?

Original comment by perli...@gmail.com on 15 Nov 2012 at 1:05