-
Notifications
You must be signed in to change notification settings - Fork 0
/
929e4a0b.684454ba.js
1 lines (1 loc) · 5.94 KB
/
929e4a0b.684454ba.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{121:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return l})),t.d(n,"metadata",(function(){return o})),t.d(n,"toc",(function(){return c})),t.d(n,"default",(function(){return p}));var a=t(3),r=(t(0),t(165)),i=(t(179),t(177));const l={id:"single",title:"Single Details Panel"},o={unversionedId:"details-panel/single",id:"details-panel/single",isDocsHomePage:!1,title:"Single Details Panel",description:"The default setting for detail panels is that multiple can be open.",source:"@site/demos/details-panel/single.mdx",slug:"/details-panel/single",permalink:"/demos/details-panel/single",version:"current",sidebar:"sidebar",previous:{title:"Basic Details Panel",permalink:"/demos/details-panel/basic"},next:{title:"Editable",permalink:"/demos/edit/editable"}},c=[{value:"Usage",id:"usage",children:[]},{value:"Live Demo",id:"live-demo",children:[]}],s={toc:c};function p(e){let{components:n,...t}=e;return Object(r.b)("wrapper",Object(a.a)({},s,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)("p",null,"The default setting for detail panels is that multiple can be open."),Object(r.b)("p",null,"By setting the option ",Object(r.b)("inlineCode",{parentName:"p"},"detailPanelType")," to ",Object(r.b)("inlineCode",{parentName:"p"},"single"),", only one panel will be open at any given time."),Object(r.b)("h2",{id:"usage"},"Usage"),Object(r.b)("pre",null,Object(r.b)("code",{parentName:"pre",className:"language-jsx"},'import MaterialTable from "@material-table/core";\n\n<MaterialTable\n // ... other props\n options={{ detailPanelType: "single" }}\n detailPanel={({ rowData }) => {\n return (\n <div\n style={{\n fontSize: 20,\n textAlign: "center",\n height: 100,\n }}\n >\n This is a detailed panel for {rowData.name}\n </div>\n );\n }}\n/>;\n')),Object(r.b)("h2",{id:"live-demo"},"Live Demo"),Object(r.b)(i.a,{mdxType:"InfoBannerAboutGlobalVarsInDemos"}),Object(r.b)("pre",null,Object(r.b)("code",{parentName:"pre",className:"language-jsx",metastring:"live",live:!0},'function BasicDetailsPanelDemo() {\n return (\n <MaterialTable\n data={DEMO_DATA}\n columns={DEMO_COLS}\n title="Single Detail Panel"\n options={{ detailPanelType: "single" }}\n detailPanel={({ rowData }) => {\n return (\n <div\n style={{\n fontSize: 20,\n textAlign: "center",\n height: 100,\n }}\n >\n This is a detailed panel for {rowData.name}.\n </div>\n );\n }}\n />\n );\n}\n')))}p.isMDXComponent=!0},165:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return f}));var a=t(0),r=t.n(a);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function o(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?l(Object(t),!0).forEach((function(n){i(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function c(e,n){if(null==e)return{};var t,a,r=function(e,n){if(null==e)return{};var t,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)t=i[a],n.indexOf(t)>=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)t=i[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var s=r.a.createContext({}),p=function(e){var n=r.a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},u=function(e){var n=p(e.components);return r.a.createElement(s.Provider,{value:n},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},b=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,s=c(e,["components","mdxType","originalType","parentName"]),u=p(t),d=a,b=u["".concat(l,".").concat(d)]||u[d]||m[d]||i;return t?r.a.createElement(b,o(o({ref:n},s),{},{components:t})):r.a.createElement(b,o({ref:n},s))}));function f(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,l=new Array(i);l[0]=b;var o={};for(var c in n)hasOwnProperty.call(n,c)&&(o[c]=n[c]);o.originalType=e,o[d]="string"==typeof e?e:a,l[1]=o;for(var s=2;s<i;s++)l[s]=t[s];return r.a.createElement.apply(null,l)}return r.a.createElement.apply(null,t)}b.displayName="MDXCreateElement"},177:function(e,n,t){"use strict";t.d(n,"a",(function(){return c}));var a=t(0),r=t.n(a),i=(t(20),t(413)),l=t(244);const o=e=>{let{type:n,children:t}=e,a=n;return"tip"===n&&(a="success"),"note"===n&&(a="secondary"),r.a.createElement(i.a,{theme:Object(l.b)()},r.a.createElement("div",{className:`admonition admonition-${n} alert alert--${a}`},r.a.createElement("div",{className:"admonition-heading"},r.a.createElement("h5",null,r.a.createElement("span",{className:"admonition-icon"},r.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},r.a.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))),n.toLowerCase())),r.a.createElement("div",{className:"admonition-content"},r.a.createElement("p",null,t))))},c=()=>r.a.createElement(o,{type:"note"},"See"," ",r.a.createElement("a",{href:"/demos/#demo-environment"},r.a.createElement("b",null,r.a.createElement("i",null,"here")))," ","for more on the ",r.a.createElement("code",null,"GLOBAL_VARS")," we use in our demos")}}]);