1_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[11],{oW5X:function(e,t,n){"use strict";n.r(t),n.d(t,"meta",(function(){return b})),n.d(t,"default",(function(){return s}));var a=n("HALo"),r=n("dhJC"),i=n("q1tI"),o=n.n(i),l=n("7ljp"),c=n("er9C"),b=(o.a.createElement,{}),p={meta:b},u=function(e){var t=e.children,n=Object(r.a)(e,["children"]);return Object(l.b)(c.a,Object(a.a)({meta:b},n),t)};function s(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(l.b)(u,Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(l.b)("h1",{id:"usecolumnorder"},Object(l.b)("inlineCode",{parentName:"h1"},"useColumnOrder"),Object(l.b)("a",Object(a.a)({parentName:"h1"},{href:"#usecolumnorder",title:"Direct link to heading",className:"anchor"}),Object(l.b)("span",Object(a.a)({parentName:"a"},{className:"icon icon-link"})))),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"Plugin Hook"),Object(l.b)("li",{parentName:"ul"},"Optional")),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"useColumnOrder")," is a plugin hook that implements ",Object(l.b)("strong",{parentName:"p"},"basic column reordering"),". As columns are reordered, their header groups are reverse-engineered so as to never have orphaned header groups."),Object(l.b)("h3",{id:"table-options"},"Table Options",Object(l.b)("a",Object(a.a)({parentName:"h3"},{href:"#table-options",title:"Direct link to heading",className:"anchor"}),Object(l.b)("span",Object(a.a)({parentName:"a"},{className:"icon icon-link"})))),Object(l.b)("p",null,"The following options are supported via the main options object passed to ",Object(l.b)("inlineCode",{parentName:"p"},"useTable(options)")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"initialState.columnOrder: Array<ColumnId>"),Object(l.b)("ul",{parentName:"li"},Object(l.b)("li",{parentName:"ul"},"Optional"),Object(l.b)("li",{parentName:"ul"},"Defaults to ",Object(l.b)("inlineCode",{parentName:"li"},"[]")),Object(l.b)("li",{parentName:"ul"},"Any column ID's not represented in this array will be naturally ordered based on their position in the original table's ",Object(l.b)("inlineCode",{parentName:"li"},"column")," structure")))),Object(l.b)("h3",{id:"instance-properties"},"Instance Properties",Object(l.b)("a",Object(a.a)({parentName:"h3"},{href:"#instance-properties",title:"Direct link to heading",className:"anchor"}),Object(l.b)("span",Object(a.a)({parentName:"a"},{className:"icon icon-link"})))),Object(l.b)("p",null,"The following values are provided to the table ",Object(l.b)("inlineCode",{parentName:"p"},"instance"),":"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("p",{parentName:"li"},Object(l.b)("inlineCode",{parentName:"p"},"setColumnOrder: Function(updater: Function | Array<ColumnId>) => void")),Object(l.b)("ul",{parentName:"li"},Object(l.b)("li",{parentName:"ul"},"Use this function to programmatically update the columnOrder."),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"updater")," can be a function or value. If a ",Object(l.b)("inlineCode",{parentName:"li"},"function")," is passed, it will receive the current value and expect a new one to be returned."))),Object(l.b)("li",{parentName:"ul"},Object(l.b)("p",{parentName:"li"},Object(l.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/tannerlinsley/react-table/tree/v7/examples/column-ordering"}),"Source"))),Object(l.b)("li",{parentName:"ul"},Object(l.b)("p",{parentName:"li"},Object(l.b)("a",Object(a.a)({parentName:"p"},{href:"https://codesandbox.io/s/github/tannerlinsley/react-table/tree/v7/examples/column-ordering"}),"Open in CodeSandbox")))))}s.isMDXComponent=!0},"oko/":function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/docs/api/useColumnOrder",function(){return n("oW5X")}])}},[["oko/",0,2,1,3,4]]]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.