Show cool things you have done with our products


Post by Roman »

Good afternoon, I work for Spider Project that allows you to schedule work, but the problem of this program is that it is not the network, I would like for your company to introduce your product to view online charts, but are faced with the problem of not understanding how to convert my XML file into Your JSON, can You help with a Converter from xml to json? below put the upload file from Spider Project, thanks in advance.
Attachments
TestProject.xml
XML Spider Project
(3.37 KiB) Downloaded 326 times

Post by mats »

You can use XML as input as well. See this sample:

https://bryntum.com/examples/scheduler-l ... esandzones

Post by Roman »

no thanks, I'd like to see the Gantt works

Post by mats »


Post by Roman »

Yes, this is the option I want to try but my problem is that I can not convert XML in json format, how can I do that?

Post by pmiklashevich »

You mustn't convert your XML data to JSON! You can use XML Reader provided by sencha.

Mats gave you a link to Lines and Zones sample to let you check how we deal with XML data. The same is true for the gantt.
resourceStore : {
        type     : 'resourcestore',
        storeId  : 'resources',
        sorters  : ['Role', 'Name'],
        autoLoad : true,
        proxy    : {
            url    : 'data/resources.xml', // HERE IS THE LINK TO XML FILE
            type   : 'ajax',
            reader : {
                type   : 'xml', // HERE YOU SPECIFY TYPE OF YOUR READER
                record : 'Resource',
                idPath : 'Id'
            }
        },
        model    : 'Sch.examples.linesandzones.model.Resource'
    },
eventStore : {
        type     : 'eventstore',
        storeId  : 'events',
        autoLoad : true,
        proxy    : {
            url    : 'data/events.xml', // HERE IS THE LINK TO XML FILE
            type   : 'ajax',
            reader : {
                type   : 'xml', // HERE YOU SPECIFY TYPE OF YOUR READER
                idPath : 'Id',
                record : 'Event'
            }
        }
    },

Pavlo Miklashevych
Sr. Frontend Developer


Post by Roman »

thanks, but I guess I fail to understand, still thanks for trying to help.

Post by mats »

All you should do is to look at our XML structure, then it'll be clear :)
<?xml version="1.0"?>
<ResourcesResponse xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance">
    <Resource>
        <Id>r1</Id>
        <Name>Mike</Name>
    </Resource>
    <Resource>
        <Id>r2</Id>
        <Name>Linda</Name>
        <Color>#9cc96b</Color>
    </Resource>
    <Resource>
        <Id>r3</Id>
        <Name>Don</Name>
        <Color>#03b4d5</Color>
    </Resource>
    <Resource>
        <Id>r4</Id>
        <Name>Karen</Name>
    </Resource>
    <Resource>
        <Id>r5</Id>
        <Name>Doug</Name>
    </Resource>
    <Resource>
        <Id>r6</Id>
        <Name>Peter</Name>
    </Resource>
</ResourcesResponse>

<?xml version="1.0"?>
<EventsResponse xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance">
    <Event>
        <Id>e101</Id>
        <ResourceId>r1</ResourceId>
        <Name>Assignment 1</Name>
        <StartDate>2011-01-04</StartDate>
        <EndDate>2011-01-06</EndDate>
    </Event>
    <Event>
        <Id>e102</Id>
        <ResourceId>r2</ResourceId>
        <Name>Assignment 2</Name>
        <StartDate>2011-01-05</StartDate>
        <EndDate>2011-01-08</EndDate>
    </Event>
    <Event>
        <Id>e103</Id>
        <ResourceId>r3</ResourceId>
        <Name>Assignment 3</Name>
        <StartDate>2011-01-06</StartDate>
        <EndDate>2011-01-08</EndDate>
    </Event>
    <Event>
        <Id>e104</Id>
        <ResourceId>r4</ResourceId>
        <Name>Assignment 4</Name>
        <StartDate>2011-01-07</StartDate>
        <EndDate>2011-01-09</EndDate>
    </Event>
    <Event>
        <Id>e105</Id>
        <ResourceId>r5</ResourceId>
        <Name>Assignment 5</Name>
        <StartDate>2011-01-03</StartDate>
        <EndDate>2011-01-05</EndDate>
    </Event>
    <Event>
        <Id>e106</Id>
        <ResourceId>r5</ResourceId>
        <Name>Assignment 6</Name>
        <StartDate>2011-01-09</StartDate>
        <EndDate>2011-01-11</EndDate>
    </Event>
</EventsResponse>


Post by pmiklashevich »

Then you have to pick some knowledge from the sencha docs:
Read about store, model, proxy, reader and writer.
Go through Ext.data.*

Pavlo Miklashevych
Sr. Frontend Developer


Post by Roman »

good day, worked unloading in json format
1. but the problem why it is not visible connection between the works, for example 1, what am I doing wrong?
and can still be implemented and may simply offer to do the grouping levels are not "children", and code a WBS? simply program the default scheduling can output a WBS-code, then you can write simple VBA code TXT->json
Attachments
load.rar
load.json
(818 Bytes) Downloaded 325 times

Post Reply