Grid

Example

Code

<fine-grid id='myGrid1' class='rtl'>
</fine-grid>

<script type="text/javascript">
  fine.ready(function(e) {
    var el = document.getElementById('myGrid1');
    el.setConfig({
      height: '300px',
      showToolbar: true,
      columns: [{
        field: "customerNumber",
        title: "ID", 
        width: '70px',
        filtering: false,
        editable: false,
      }, {
        field: "customerName",
        title: "Customer Name",
        width: '35%',
      }, {
        field: "phone",
        title: "Phone",
        width: '100px',
        filtering: false,
      }, {
        field: "city",
        title: "City",
      }, {
        field: "country",
        title: "Country",
      }, {
        commands: ["Edit", "Delete"],
        editingCommands: ["Save", "Cancel"],
        width: '160px',
        filtering: false,
      }],
      dataSource: {
        schema: {
          model: {
            idField: 'customerNumber',
            fields: {
              customerNumber: {
                type: 'string'
              },
              customerName: {
                type: 'string'
              },
              phone: {
                type: 'number'
              },
              city: {
                type: 'string'
              },
              country: {
                type: 'string'
              }
            }
          }
        },
        transport: {
          read: {
            url: "../php/example.php",
            dataType: "text"
          },
          update: {
            url: "../php/example.php",
            dataType: "text"
          },
          create: {
            url: "../php/example.php",
            dataType: "text"
          },
          destroy: {
            url: "../php/example.php",
            dataType: "text"
          }
        },
        serverPaging: false,
        serverFiltering: false,
        serverSorting: false,
      },
      paging: {
       pageSize: 20
      },
      sorting: {
        type: 'multiple',
      },
      filtering: true,
      editing: 'batch'
    });
  });
  
</script>