0

I can load data into the table successfully. but i need to load this data into a Jqgrid. this all data getting from dynamic array (include table header). I try ed it but still i unable to do this. Any one can help?

I used Jqgrid 4.0

this my code for data loading to table /////////////////////////////////////

<table id="jqTable" border="1" style="margin-top: 10px;">
    <thead>
        <tr>
            <th style="min-width: 50px;"></th>
            {% for keys,values in tableHead %}

                <th style="min-width: 50px;"><a href="#" onclick="loadResourceSummary({{projectIds[values['unit_code']]}},null,null)">{{values['unit_code']}}</a></th>

            {% endfor %}
            <th style="min-width: 60px;">{{'Total'}}</th>
        </tr>
    </thead>

    {% for keys,values in matrix %}
        <tr>
            <td><a href="#" onclick="viewSummary({{userIds[keys]}})">{{full_names[keys]}}</a></td>
            {% for key,value in values %}
                {% if value=="-"%}
                    <td style="text-align: right;">{{value}}</td>
                {% else%}
                    <td style="text-align: right;"><a href="#" onclick="loadRRFSummary({{projectIds[key]}},{{userIds[keys]}});"> {{value ~" %"}} </a></td>
                {%endif%}
            {% endfor %}
            <td bgcolor="#dcdcdc" style="text-align: right; font-weight: bold;">{{(totalAllocationOfTheUser[keys]) ~" %"}}</td>
        </tr>
    {% endfor %}
    <tr>
        <td><strong>{{'Total'}}</strong></td>
        {% for keys,values in totalAllocationOfTheProject %}
            <td bgcolor="#dcdcdc" style="text-align: right; font-weight: bold;">
                {{values}}

            </td>
        {% endfor %}
        <td style="text-align: right; font-weight: bold;"><span style="color: #a52a2a;">{{grandTotal}}</span></td>
    </tr>
</table>

/////////////////////////////////// this is the return array to twig file /////////////////////////////////

$tableHead=$userDAO->getSelectedProjectsForMatrix($selectedProjects);
        return $this->render('AdminBundle:User:ProjectsMatrix.html.twig', array(
            'matrix'=>$matrix['matrix'], 'tableHead'=>$tableHead,'full_names'=>$matrix['userWithFullName'],
            'totalAllocationOfTheUser'=> $matrix['totalAllocationOfTheUser'],'totalAllocationOfTheProject'=>$matrix['totalAllocationOfTheProject'],
            'form' => $form->createView(),'date'=>$date,'userIds'=>$matrix['userIds'],'projectIds'=>$matrix['projectIds'],'grandTotal'=>$matrix['grandTotal']
        ));
  • 2
    Could you post paste the code here instead of using an image? – j0k Feb 27 '13 at 13:16
  • You should include a detailed problem description in the question. What doesn't work? What did you try to fix it? Where did you fail? – Maerlyn Feb 27 '13 at 15:44
  • I want to load data into jqgrid using dynamic array.column names are all so generate in dynamically – user2109796 Feb 28 '13 at 05:29

0 Answers0