How to make Horizontal SpinnerList - flash-builder

I am using SpinnerList in my applicaiton and by default it has a vertical layout. But I have a requirement of Horizontal SpinnerList.
I tried rotation,direction but couldn't make a horizontal spinner list.
<s:titleContent>
<s:SpinnerListContainer direction="ltr" autoLayout="true">
<s:SpinnerList id="titleSpinner" textAlign="center">
<s:ArrayList>
<fx:String>First</fx:String>
<fx:String>Second</fx:String>
<fx:String>Third</fx:String>
<fx:String>Fourth</fx:String>
<fx:String>Fifth</fx:String>
</s:ArrayList>
</s:SpinnerList>
</s:SpinnerListContainer>
</s:titleContent>
Please guide me.

<s:Scroller id="scrllr" focusEnabled="false"
hasFocusableChildren="true"
width="100%">
<s:HGroup id="hg" gap="20"
paddingTop="5" paddingRight="5" paddingBottom="5" paddingLeft="5">
<s:Label text="First" color="White"
focusIn="textinput_focusInHandler(event)"/>
<s:Label text="Second" color="White"
focusIn="textinput_focusInHandler(event)" />
<s:Label text="Third" color="White"
focusIn="textinput_focusInHandler(event)" />
<s:Label text="Fourth" color="White"
focusIn="textinput_focusInHandler(event)" />
<s:Label text="Fifth" color="White"
focusIn="textinput_focusInHandler(event)" />
<s:Label text="Sixth" color="White"
focusIn="textinput_focusInHandler(event)" />
</s:HGroup>
</s:Scroller>
protected function textinput_focusInHandler(evt:FocusEvent):void
{
var idx:int = hg.getElementIndex(evt.target as IVisualElement);
var lay:HorizontalLayout = hg.layout as HorizontalLayout;
if(lay.fractionOfElementInView(idx)<1)
{
lay.horizontalScrollPosition +=lay.getScrollPositionDeltaToElement(idx).y;
}
}

Related

add icons in actions columns and in each row - react admin

I want to add a column on List in react admin and it has to have two actions. Now, each action is a column and I can't add a header title.
For example:
<List>
<Datagrid>
<TextField label="Id" source="order.id" />
<DateField label="Inicio" source="startDate" />
<CheckIcon
color="action"
onClick={(e) => confirmOrder(e)}
/>
<CancelIcon
color="action"
onClick={(e) => cancelOrder(e)}
/>
</Datagrid>
</List>
I want to create a column "Actions" and add both CheckIcon and CancelIcon.
Wrap them inside a custom field:
const OrderActions = () => (
<>
<IconButton onClick={(e) => confirmOrder(e)}>
<CheckIcon color="action" />
<IconButton>
<IconButton onClick={(e) => cancelOrder(e)}>
<CancelIcon color="action" />
<IconButton>
</>
)
Then:
<List>
<Datagrid>
<TextField label="Id" source="order.id" />
<DateField label="Inicio" source="startDate" />
<OrderActions />
</Datagrid>
</List>

How to make a full width render on ReferenceManyField?

I have a react-admin show page configured with some ReferenceManyField components like this one:
<ReferenceManyField
reference="children"
target="userId"
label="Enfants"
>
<Datagrid
rowClick="edit"
>
<TextField
source="lastName"
label="Nom"
/>
<TextField
source="firstName"
label="Prénom"
/>
<DateField
source="birthday"
label="Date de naissance"
showTime={false}
/>
<TextField
source="phoneNumber"
label="Tél."
/>
</Datagrid>
</ReferenceManyField>
It works, but the rendered tab are content sized:
My question is quite simple: How to make it full width?
I tried the fullWidth option on ReferenceManyField without any effect.

How to change the row background of list, when i click the row

I am using react-admin to work for my program.
when I use the ,I do not know how to set the backgroundColor of row when i click it.
const rowStyle = record => ({
backgroundColor:
record.id === window.location.pathname.split('/')[2] ? '#e0e0e0' : '',
});
<List
{...props}
bulkActions={false}
actions={<ListActions />}
exporter={exporter}
pagination={<Pagination />}
filters={<SaleInventoryFilter />}
>
<Datagrid rowClick="show" rowStyle={rowStyle}>
<TextField source="item.code" label="Item code" />
<TextEllipsisField
source="item.name"
label="Item name"
cellClassName={classes.name}
/>
<TextField source="stockLocation.name" label="Stock location" />
<TextField source="batch" />
<TextField source="leadTime" label="Lead time (days)" />
<TextField source="onHandQty" label="On hand" />
<TextField source="availableQty" label="Available" />
<TextField source="reservedQty" label="Reserved" />
<DateField
source="updatedAt"
label={`Updated At (${getOffsetByTimezone()})`}
/>
<OperationButton />
</Datagrid>
</List>
Above is my work, but it works always have delay.
It need to wait re-render of component.
I expect when I click the row the row backgroundColor will change to red immediately whether the component have re-render.

How to give gradient to text in horizontal direction react-native-svg

I was trying to add gradient to the text in my react-native project using react-native-svg
<Svg height="50"
width="300" >
<LinearGradient id="Gradient" x1="0" x2="800" y1="0" y2="0">
<Stop offset="0" stopColor="#C2515D" stopOpacity="0" />
<Stop offset="1" stopColor="black" stopOpacity="1" />
</LinearGradient>
<Text fill="url(#Gradient)"
x="0"
y="30"
fontSize="30"
textAnchor="start">
Sign Up
</Text>
</Svg>
Here I was getting only (#C2515D) this color, I cant able to get black color, trying from 5 hours. Any suggestions?
It is all because of X2 position, I changed my x2 position to 100 and set the stop color as
`<Stop stopColor="#C2515D" offset="0%" />
<Stop stopColor="black" offset="70%" />
`
Hope this helps someone who got struck with this issue

react-native tabbar bottom hides a component

I am building a profile page and have the following components.
1. I have a image picker for the profile picture
2. ListView with text fields and a button
And i have a bottom bar navigation. With the current implementation the bottom tab bar hides the button at the bottom, and i am not able to figure out a way to solve this. Any help would be appreciated. Below is the code snippet,
render(){
let {phone} = this.state,
{studentName}=this.state,
{studentClass}=this.state,
{bloodGroup}=this.state,
{parentName}=this.state,
{email}=this.state,
{sibling}=this.state,
{siblingClass}=this.state,
{address}=this.state;
return(
<View style={styles.studentInfo}>
<TextField
label='Student Name'
value={studentName}
onChangeText={(studentName)=>this.setState({studentName})}
/>
<TextField
label='Class'
value={studentClass}
onChangeText={(studentClass)=>this.setState({studentClass})}
/>
<TextField
label='Blood Group'
value={bloodGroup}
onChangeText={(bloodGroup)=>this.setState({bloodGroup})}
/>
<TextField
label='Parent Name'
value={parentName}
onChangeText={(parentName)=>this.setState({parentName})}
/>
<TextField
label='Phone Number'
value={phone}
onChangeText={(phone)=>this.setState({phone})}
/>
<TextField
label='E mail'
value={email}
onChangeText={(email)=>this.setState({email})}
/>
<TextField
label='Sibling Studying in the school'
value={sibling}
onChangeText={(sibling)=>this.setState({sibling})}
/>
<TextField
label='Class'
value={siblingClass}
onChangeText={(siblingClass)=>this.setState({siblingClass})}
/>
<TextField
label='Address'
value={address}
onChangeText={(address)=>this.setState({address})}
/>
<Button
style={{backgroundColor: '#3e9cd3'}}
textStyle={{fontSize: 18}}
onPress={()=> this.handleButtonPress()}>
Save
</Button>
</View>
);
}