Designing Import and Export
Let's start by thinking about the Quotation
table. Because Bill
is mostly the same as Quotation
, we'll just implement Quotation
here. Try this implementation with Bill
, as well by yourself. First, we'll add an Export
and Import
button in the Quotation
list, so that it begins to function. Next, we'll make the file start downloading when the Export
button is pressed. We'll add a new panel so that we can visually check the selected data that we are about to import. So let's go ahead and create this type of data import and export functions.
Data format
At first, when exporting, let's consider the data format in which it will be downloaded. This time, we're thinking of outputting in the TSV format instead of CSV or XML. TSV is easier for the developers to read and it's very simple to generate with JavaScript. The following list shows the order of output.
Quotation
and Quotations
are outputted in a single file. In the case of quotation, the order of output is as follows...