@@ -143,6 +143,64 @@ React.render(
143143)
144144```
145145
146+ ## Solo Filtering ##
147+
148+ The ` solo ` prop allows you to filter data to show only specific values. It supports both single values and arrays for multi-value filtering.
149+
150+ ### Single Value Filtering (Original Behavior)
151+
152+ ``` jsx
153+ < ReactPivot
154+ solo= {{ firstName: ' John' , state: ' NY' }}
155+ // ... other props
156+ / >
157+ ```
158+
159+ ### Array Value Filtering (New Feature)
160+
161+ ``` jsx
162+ < ReactPivot
163+ solo= {{
164+ firstName: [' John' , ' Jane' , ' Bob' ],
165+ state: [' NY' , ' CA' ]
166+ }}
167+ // ... other props
168+ / >
169+ ```
170+
171+ ### Mixed Value Filtering
172+
173+ ``` jsx
174+ < ReactPivot
175+ solo= {{
176+ firstName: [' John' , ' Jane' ], // Multiple values
177+ department: ' Engineering' , // Single value
178+ state: [' NY' , ' CA' , ' TX' ] // Multiple values
179+ }}
180+ // ... other props
181+ / >
182+ ```
183+
184+ ### Filtering Logic
185+
186+ - ** Within arrays** : Uses OR logic (matches any value in the array)
187+ - ** Between properties** : Uses AND logic (all properties must match)
188+ - ** Empty arrays** : Filter out all rows for that property
189+ - ** Display** : Array values are shown as comma-separated strings
190+
191+ ### Example
192+
193+ ``` jsx
194+ // This configuration:
195+ solo= {{
196+ state: [' NY' , ' CA' ],
197+ department: [' Sales' , ' Marketing' ]
198+ }}
199+
200+ // Would match rows where:
201+ // (state === 'NY' OR state === 'CA') AND (department === 'Sales' OR department === 'Marketing')
202+ ```
203+
146204See it all together in [ example/basic.jsx] ( https://github.com/davidguttman/react-pivot/blob/master/example/basic.jsx )
147205
148206### Optional Arguments ###
@@ -154,7 +212,7 @@ csvTemplateFormat | boolean | apply template formatting to data before csv expor
154212defaultStyles | boolean | apply default styles from style.css | true
155213hiddenColumns | array | columns that should not display | [ ]
156214nPaginateRows | number | items per page setting | 25
157- solo | object | item that should be displayed solo | null
215+ solo | object | item that should be displayed solo. Values can be strings or arrays of strings for multi-value filtering | null
158216sortBy | string | name of column to use for record sort | null
159217sortDir | string | sort direction, either 'asc' or 'desc' | 'asc'
160218tableClassName | string | assign css class to table containing react-pivot elements | ''
0 commit comments