Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

View file
nameKonfiguracja-watermark.txt
height250

 

Konfiguracja schematu graficznego dla tablic


Poniżej przykłady:

1) Tablica 

Code Block
titleJSON
{
	"table1": 
	[
		"EUR",
		"USD",
		"AUD"
	]
}

 


Code Block
titleKonfiguracja schematu graficznego
 schema: {
      fields: [{
        type: "field-array",
        label: "Waluty w tablicy",
        model: "table1",
      }]
	 }

2) Tablica tablic

Code Block
titleJSON
 {
	"table2": [
		[
			"EUR"
		],
		[
			"USD"
		],
		[
			"AUD"
		]
	]
}
Code Block
titleKonfiguracja schematu graficznego
 schema: {
      fields: [{
        type: "field-array",
        label: "Waluty w tablicy",
        model: "table2",
      }]
	 }

3) Tablica obiektów

Code Block
titleJSON
 {
	"table3": [
		{
			"id": 1,
			"wydatek": "Rodzaj wydatku 1"
		},
		{
			"id": 2,
			"wydatek": "Rodzaj wydatku 2"
		}
	]
}
Code Block
titleKonfiguracja schematu graficznego
 schema: {
      fields: [{
        type: "field-array",
        label: "Tablica obiektów",
        model: "table3",
        schema: {
          fields: [{
            type: "input",
            inputType: "text",
            label: "ID",
            model: "id"
          },
            {
              type: "input",
              inputType: "text",
              label: "Rodzaj wydatku",
              model: "wydatek"
            }
          ]
        }
      }]
	 }

4) Tablica tablic z obiektami

Code Block
titleJSON
 {
	"table4": [
		[
			{
				"id": 1,
				"wydatek": "Rodzaj wydatku 1"
			}
		],
		[
			{
				"id": 2,
				"wydatek": "Rodzaj wydatku 2"
			}
		]
	]
}
Code Block
titleKonfiguracja schematu graficznego
 schema: {
      fields: [{
        type: "field-array",
          label: "Tablica tablic z obiektami",
          model: "table4",
          maxHeight: "200",
          schema: {
            fields: [{
              type: "input",
              inputType: "text",
              label: "ID",
              model: "id"
            },
              {
                type: "input",
                inputType: "text",
                label: "Rodzaj wydatku",
                model: "wydatek"
              }
            ]
          }
      }]
	 }

5) Tablica obiektów posiadających dane i tablicę obiektów

Code Block
titleJSON
 {
	"table5": [
		{
			"id": 1,
			"table5_1": [
				{
					"id": 1,
					"wydatek": "Rodzaj wydatku 1"
				},
				{
					"id": 2,
					"wydatek": "Rodzaj wydatku 2"
				}
			]
		},
		{
			"id": 2,
			"table5_1": [
				{
					"id": 1,
					"wydatek": "Rodzaj wydatku 1"
				},
				{
					"id": 2,
					"wydatek": "Rodzaj wydatku 2"
				}
			]
		}
	]
}
Code Block
titleKonfiguracja schematu graficznego
 schema: {
      fields: [{
          type: "field-array",
          label: "Tablica obiektów posiadających dane i tablicę obiektów ",
          model: "table5",
          maxHeight: "200",
          schema: {
            fields: [{
              type: "input",
              inputType: "text",
              label: "ID",
              model: "id"
            },
              {
                type: "field-array",
                label: "table5_1",
                model: "table5_1",
                maxHeight: "200",
                schema: {
                  fields: [{
                    type: "input",
                    inputType: "text",
                    label: "ID",
                    model: "id"
                  },
                    {
                      type: "input",
                      inputType: "text",
                      label: "Rodzaj wydatku",
                      model: "wydatek"
                    }
                  ]
                }
              }
            ]
          }
        }]
	 }

6) Poperty posiadający tablicę obiektów posiadających dane i tablicę obiektów

Code Block
titleJSON
 {
	"table6": {
		"table6_1": [
			{
				"id": 1,
				"table6_2": [
					{
						"id": 1,
						"wydatek": "Rodzaj wydatku 1"
					},
					{
						"id": 2,
						"wydatek": "Rodzaj wydatku 2"
					}
				]
			},
			{
				"id": 2,
				"table6_2": [
					{
						"id": 1,
						"wydatek": "Rodzaj wydatku 1"
					},
					{
						"id": 2,
						"wydatek": "Rodzaj wydatku 2"
					}
				]
			}
		]
	}
}
Code Block
titleKonfiguracja schematu graficznego
 schema: {
      fields: [{
          type: "field-array",
          label: "Popertis posiadający tablicę obiektów posiadających dane i tablicę obiektów ",
          model: "table6.table6_1",
          schema: {
            fields: [
              {
                type: "input",
                inputType: "text",
                label: "ID",
                model: "id"
              },
              {
                type: "field-array",
                label: "table6_2",
                model: "table6_2",
                schema: {
                  fields: [{
                    type: "input",
                    inputType: "text",
                    label: "ID",
                    model: "id"
                  },
                    {
                      type: "input",
                      inputType: "text",
                      label: "Rodzaj wydatku",
                      model: "wydatek"
                    }
                  ]
                }
              }
            ]
          }
        }]
	 }