Bug 177989 - Web Inspector: Improve setting the default / initial sort of a Table
Summary: Web Inspector: Improve setting the default / initial sort of a Table
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-05 20:27 PDT by Joseph Pecoraro
Modified: 2017-10-06 09:39 PDT (History)
5 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (3.85 KB, patch)
2017-10-05 20:30 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2017-10-05 20:27:48 PDT
Improve setting the default / initial sort of a Table

Its hard / impossible to set the initial sort of a Table. Lets make it easier and better.

    let table = new Table(identifier, ...);
    if (!table.sortColumnIdentifier) {
        table.sortOrder = ...;
        table.sortColumnIdentifier = ...;
    }

The initialLayout of the table will ensure it displays appropriately.
Comment 1 Joseph Pecoraro 2017-10-05 20:30:32 PDT
Created attachment 322980 [details]
[PATCH] Proposed Fix

I like this approach for setting up the default sort. Its easy to find and not too invasive in code. It probably depends on ordering (ensure columns are added before setting the default sort) but thats a pattern I'm already following and encouraging.
Comment 2 BJ Burg 2017-10-06 09:10:44 PDT
Comment on attachment 322980 [details]
[PATCH] Proposed Fix

r=me
Comment 3 WebKit Commit Bot 2017-10-06 09:38:00 PDT
Comment on attachment 322980 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 322980

Committed r222983: <http://trac.webkit.org/changeset/222983>
Comment 4 WebKit Commit Bot 2017-10-06 09:38:02 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2017-10-06 09:39:02 PDT
<rdar://problem/34857354>