views:

326

answers:

1

I have my columns set as follows:

colModel : [
                {display: 'column1', name : 'column1', width : 200, sortable : true, align: 'center'},
                {display: 'column2', name : 'column2', width : 100, sortable : true, align: 'left'},
                {display: 'column3', name : 'column3', width : 100, sortable : true, align: 'left'},
                {display: 'column4', name : 'column4', width : 300, sortable : true, align: 'left'},
            ],

I set my data source to a url that returns xml. The xml is like this:

<?xml version="1.0"?>
<items_list>
  <item>
    <column1>BlahBlah</column1>
    <column2>BlahBlah</column2>
    <column3>BlahBlah</column3>
    <column4>BlahBlah</column4>
  </item>

  <item>
    <column1>BlahBlah</column1>
    <column2>BlahBlah</column2>
    <column3>BlahBlah</column3>
    <column4>BlahBlah</column4>
  </item>
</items_list>

How can I bind the grid to the xml datasource, it doesn't appear to recognize it as it is?

+1  A: 

flexigrid expects xml to be formatted in a specific way like this

  <?xml version="1.0" encoding="utf-8"?>
  <rows>
    <page>1</page>
    <total>2</total>
    <row id='1'>
        <cell><![CDATA[abc]]></cell>
        <cell><![CDATA[abc]]></cell>
        <cell><![CDATA[abc]]></cell>
        <cell><![CDATA[123]]></cell>
        <cell><![CDATA[123]]></cell>
    </row>
    <row id='2'>
        <cell><![CDATA[abc]]></cell>
        <cell><![CDATA[abc]]></cell>
        <cell><![CDATA[abc]]></cell>
        <cell><![CDATA[123]]></cell>
        <cell><![CDATA[123]]></cell>
    </row>
  </rows>
mcgrailm
Awesome mmcgrail. Do you happen to have any additional examples? (links etc?) The CDATA identifier is always the same, it doesn't have to match up with column names?
stormist
I don't have any examples because I use json. the <![CDATA[blahblah]]> is your values. so each cell should be inline with the way you have the columns setup in the flexigrid, follow ?
mcgrailm
Can't seem to get it to work.. Does the "cell" entry have to match up with column name instead of the word cell? Thanks for taking the time to answer.
stormist
can you update your post with the new xml that your using please
mcgrailm