Jump to content

Search the Community

Showing results for tags 'grid'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

There are no results to display.

Forums

  • Welcome to Smart Mobile Studio
    • News and Information
    • Pre-Sales Questions
    • Smart In the Media
    • Smart Contests
    • Meta
  • Smart Mobile Studio Discussion
    • General
    • IDE
    • RTL
    • Code
    • Client Server
    • Platform
    • Graphics
    • Deployment
    • Suggestion box
  • Smart Mobile Studio support
    • Support
    • Bug report
  • General Discussion
    • Pascal
    • Delphi
    • Javascript
    • HTML/HTML5
    • CSS
  • Resources
    • Website
    • Download Smart Mobile Studio

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Company name


Position

Found 4 results

  1. lynkfs

    table grid

    the simplest of grids, based on the html <table> element usage var W3TableElement1 : TW3TableElement := TW3TableElement.Create(W3Panel1); //add 4 columns to the grid W3TableElement1.AddColumn('Name',200); //title, width W3TableElement1.AddColumn('Description',200); W3TableElement1.AddColumn('Type',150); W3TableElement1.AddColumn('Status',50); for var i := 0 to 2 do begin W3TableElement1.AddCell(i+1,1,'Name-'+inttostr(i)); //row,column,text W3TableElement1.AddCell(i+1,2,'Desc-'+inttostr(i)); W3TableElement1.AddCell(i+1,3,'Type-'+inttostr(i)); W3TableElement1.AddCell(i+1,4,'Stat-'+inttostr(i)); end; W3Panel1.NativeScrolling := true; component unit HTMLTableElement; interface uses SmartCL.System, System.Types, SmartCL.Components; type TW3TableElement = class(TW3CustomControl) protected function MakeElementTagObj : THandle; override; TableRow : Variant; public procedure AddColumn(title: string; colwidth: integer); procedure AddCell(row, column: integer; cell: String); ColumnCount : integer := 0; RowCount : integer := 0; end; implementation { TW3TableElement } function TW3TableElement.MakeElementTagObj : THandle; begin Result := w3_createHtmlElement('table'); end; procedure TW3TableElement.AddColumn(title: string; colwidth: integer); begin // Inc(ColumnCount); //when inserting the first column, do a rowInsert for the column titles If ColumnCount = 1 then begin TableRow := handle.insertRow(0); Inc(RowCount); end; // Insert a cell in the row at index [column] var newCell = TableRow.insertCell(columnCount-1); newCell.setAttribute('bgColor','lightgrey'); newCell.setAttribute('width',inttostr(colwidth)+'px'); // Append a text node to the cell var newText = browserapi.document.createTextNode(title); newCell.appendChild(newText); end; procedure TW3TableElement.AddCell(row, column: integer; cell: String); begin // //when inserting the first cell in a row, do a rowInsert If Column = 1 then begin TableRow := handle.insertRow(RowCount); Inc(RowCount); end; // Insert a cell in the row at index [column] var newCell = TableRow.insertCell(column-1); // Append a text node to the cell var newText = browserapi.document.createTextNode(cell); newCell.appendChild(newText); end; end. note : this is an upgraded unit as referred to in this post - method 1
  2. Hello again. Is there any way to show a grid with the resizeable columns? I have tried TW3Grid adding columns and assigning their sizes. In resize I have assigned a percentage to each column (colCode = 5, colName = 80, colState = 15, for example) and I change the width to each of the columns: Grid1.Columns [n] .Width: = Grid.ClientWidth * colCode div 100, etc. The new columns are displayed correctly but those that already exist do not (it seems that the rows are simple concatenations of text). I do not know if it can be done with TW3CustomDBgrid, but I have not found examples. It is also important that they respond to the onClick event (if it can be per cell better than per row, if possible). Maybe it is possible to use listview with several columns?
  3. IElite

    Smart Mobile Studio Grid

    Jon is still plugging away on the RTL Smart Mobile Grid part 3 Smart Mobile Studio Grid 2 Smart Mobile Studio Grid
  4. GS160131

    How to add a border to a grid?

    Hi all, how can I add a border to a grid, especially to the cells of the grid? This coding does work only for the grid itself, not for the cells: MyGrid := TW3Grid.Create(Self); MyGrid.Border.SetStyle(TW3BorderEdgeStyle.besSolid); MyGrid.Border.Left.Width:=1; MyGrid.Border.Top.Width:=1; MyGrid.Border.Right.Width:=1; MyGrid.Border.Bottom.Width:=1; MyGrid.Visible := True; The cells itself seem not to have a border property. Thanks in advance
×