Skip to content

Commit

Permalink
Fix primefaces#1367: Column resizeable attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed May 9, 2022
1 parent 72050fe commit fbf9e10
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
12 changes: 12 additions & 0 deletions components/doc/datatable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2522,6 +2522,18 @@ export const DataTableRowExpansionDemo = () => {
<Column field="quantity" header="Quantity" style={{width:'30%'}}></Column>
</DataTable>
`}
</CodeHighlight>

<p>You can choose which columns are <i>resizeable</i> per column.</p>
<CodeHighlight>
{`
<DataTable value={products} resizableColumns>
<Column field="code" header="Code" style={{width:'20%'}}></Column>
<Column field="name" header="Name" style={{width:'40%'}}></Column>
<Column field="category" header="Category (not resizable)" style={{width:'20%'}} resizeable={false} />
<Column field="quantity" header="Quantity" style={{width:'30%'}}></Column>
</DataTable>
`}
</CodeHighlight>

<h5>Column Reorder</h5>
Expand Down
12 changes: 11 additions & 1 deletion pages/datatable/colresize.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const DataTableColResizeDemo = () => {
<DataTable value={products} resizableColumns columnResizeMode="fit" showGridlines responsiveLayout="scroll">
<Column field="code" header="Code" style={{width:'20%'}}/>
<Column field="name" header="Name" style={{width:'40%'}}/>
<Column field="category" header="Category (not resizable)" style={{width:'20%'}} resizeable={false} />
<Column field="category" header="Category" style={{width:'20%'}} />
<Column field="quantity" header="Quantity" style={{width:'20%'}}/>
</DataTable>
</div>
Expand All @@ -53,6 +53,16 @@ const DataTableColResizeDemo = () => {
<Column field="quantity" header="Quantity"></Column>
</DataTable>
</div>

<div className="card">
<h5>Choose Resiable Columns</h5>
<DataTable value={products} resizableColumns columnResizeMode="fit" showGridlines responsiveLayout="scroll">
<Column field="code" header="Code" style={{width:'20%'}}/>
<Column field="name" header="Name" style={{width:'40%'}}/>
<Column field="category" header="Category (not resizable)" style={{width:'20%'}} resizeable={false} />
<Column field="quantity" header="Quantity" style={{width:'20%'}}/>
</DataTable>
</div>
</div>

<DataTableColResizeDemoDoc></DataTableColResizeDemoDoc>
Expand Down

0 comments on commit fbf9e10

Please sign in to comment.