I have a set of multilevel data to be display using abovementioned component. Usually in PHP I simply iterate the data to display it as li but coming from web background, I just can't put it all together when using react-native. What is the right way to display a set of menu
FYI, I'm also using react-native-router-flux to manage the router.
If you want to build you own menu, you'll have to customize the renderRow of your ListView. If you take a look at RN's official doc on ListView here, it shows that you can specify a sectionID, for example.
You can then specify how each row renders.
renderRow: function (rowData, sectionID, rowID, highlightRow) => renderable
Takes a data entry from the data source and its ids and should return
a renderable component to be rendered as the row. By default the data
is exactly what was put into the data source, but it's also possible
to provide custom extractors. ListView can be notified when a row is
being highlighted by calling highlightRow(sectionID, rowID). This sets
a boolean value of adjacentRowHighlighted in renderSeparator, allowing
you to control the separators above and below the highlighted row. The
highlighted state of a row can be reset by calling highlightRow(null).
Another option is using open source modules built by the community.
The one closest to your needs I could find is : https://github.com/jaysoo/react-native-menu
Related
This is the component:
https://marmelab.com/react-admin/SimpleFormIterator.html
I want the first item to be required, and the user shouldn't be able to delete it.
As far as I understand, there is no built-in way for this component to do this, at this point.
I am wondering if there is a way to create a custom wrapper for this component, that can do this. Maybe render the first item separately within this custom wrapper?
To show the first item by default, you can set the default value to an empty array of objects.
<ArrayInput
source="address"
label="address"
defaultValue={[{}]}
></ArrayInput>
How to deselect the first PivotItem. I am displaying A to Z pivot item and currently its always selecting first letter A. Could you please tell me how to deselect the first element? Thanks!
I want to use getStyles property interface. But not sure how to override. any samples would be great. Thanks
getStyles?: IPivotStyles;
If you mean by deselecting first PivotItem selecting a specific one you always provide by yourself vs selecting the first one in the list, then there are several props on the Pivot allowing you to do that. Here you can see all of them listed as props on the component. By default, if none of them are provided you will get the first PivotItem selected on render. In here you can see a demo of using the initialSelectedKey prop.
There is no way to deselect them all as Pivot needs to know what to render when it mounts.
As for the getStyles usage, I believe you are using Fabric 5 because in Fabric 6 the prop was renamed to styles and it can take a style object or a style function that returns a style object. In the same codepen, you can see how I changed the color of the links by passing a style object.
We are currently using a tree grid of dojo dgrid. The expanding arrows of tree grid are placed as first column. This first column is mapped with a attribute in the store.
Currently the value of that attribute is getting displayed along with the expending arrow. But our requirement is to hide the value and display only the arrows.
Can anyone suggest a way to configure this requirement in tree dgrid column?
Tree's logic for rendering expand icons attempts to piggyback off of any existing renderCell function for the column in question. By default, dgrid renders the value pertaining to the field each column represents, but you could easily override your expand icon column to have an empty renderCell function (i.e. renderCell: function () {}), and then Tree would simply add the expand icon to an otherwise empty cell.
I have an EnhancedGrid which is bound to a dynamic Store. I am using lazy loading, so as I scroll down, more data will be fetched and bound.
I also have an "add new Item" functionality. This will open a pop-up where the user creates the new Item in a form, and on Save the item is added to the store. with dojo.data.ObjectStore.newItem() and dojo.data.ObjectStore.save().
My problem, after using those two functions, the item is automatically appended to the grid at the bottom, which is kinda of a nuisance. The user will have to scroll down to find it, which would trigger the lazy loading.
After following the code around, I found out that newItem() calls the dojox.grid.DataGrid._addItem(item, index, noUpdate) function.
I managed to overwrite it so when I am adding a new item, the _addItem function will be called with index 0. But that does not work since it was just replacing the first row with the new one instead of prepending it.
Is there any other way to look at this? is it possible to actually do it?
I am trying to delete the selected record from the drop-down grid.
In trying to do this, I've so far learned that DSOperationType.FETCH is called when the fetchData() method is called on ValuesManager class. So now I want to know what line should be executed for calling DSOperationType.REMOVE.
Or is there a better way to accomplish this task?
DSOperationType.REMOVE will be called only when removing data/row from list grid or tree grid. It can be triggered functionally by calling ListGrid.removeData(someData) or ListGrid.removeSelectedData();
But for ComboBox/SelectBox (DropDown) type item there is no functionality to remove data from list as it can only be selected from a list of data (while loading data for list FETCH operation will be called).
You can implement the functionlity indirectly by using Combobox/SelectItem with listgrid - (ex:http://www.smartclient.com/smartgwt/showcase/#dropdown_grid_combobox_category). In listgrid you can have remove data functionality. Also check other types of functionality that can be implemented with combobx http://www.smartclient.com/smartgwt/showcase/#multi_select_combobox_category