Welcome Guest, Not a member yet? Register   Sign In
Show Child data with jquery
#1

[eluser]dinda[/eluser]
i all,
i wanna auto show child data without refresh whole page using jquery, and i don't know the javascript, any body can help me please.

View : parent.php
Code:
<!-- Show Parent Data -->    
<table class="table">
    <thead>
        <tr>
            <th width="30">ParentID</th>
            <th width="343">ParentDesc</th>
            <th width="343">Refresh Child Data with this Parent ID</th>
        </tr>
    </thead>
        
    <tbody>
    &lt;?php foreach($parentresults->result() as $parent): ?&gt;
        <tr>
            <td>&lt;?=$parent->parentid?&gt;</td>
            <td>&lt;?=$parent->parentdesc?&gt;</td>
            <td>&lt;?=anchor('parent/show_child/'.$parent->parentid, 'View this Child with ajax')?&gt;</td>
        </tr>
    &lt;?php endforeach ?&gt;
    </tbody>
</table>
<br>

&lt;!-- Show Child Data --&gt;    
<table class="table">
    <thead>
        <tr>
            <th width="30">ParentID</th>
            <th width="30">ChildID</th>
            <th width="343">ChildDesc</th>
        </tr>
    </thead>
        
    <tbody>
    &lt;?php foreach($childresults->result() as $child): ?&gt;
        <tr>
            <td>&lt;?=$child->parentid?&gt;</td>
            <td>&lt;?=$child->childid?&gt;</td>
            <td>&lt;?=$child->childdesc?&gt;</td>
        </tr>
    &lt;?php endforeach ?&gt;
    </tbody>
</table>

thanks.




Theme © iAndrew 2016 - Forum software by © MyBB