Create a FlatList in react native with header that allows me to move between 2 FlatList - react-native

i want to create an app that have 2 FlatList:
For example:
Header with 2 choises "TOP 10" , "TOP20"
if i click "TOP 10" i want to see the list with top10, if i click "TOP 20" i want to see a list with top20.
Can someone help me please?

Related

How to insert parent logo on Quotation/Order report?

I'm trying to insert the logo of my client on the "Quotation/Order" report. I already got to insert the logo of the contacts of the clients using the code below on the report_saleorder_document view:
<img t-if="doc.partner_id.image_256" t-attf-src="data:image/*;base64,{{doc.partner_id.image_256}}" class="img img-responsive" alt="User Image"/>
The problem is: the logo is not present on the partner_id, but it is stored on the parent.partner_id
I already tried the code below, but not working.
<img t-if="doc.parent.partner_id.image_256" t-attf-src="data:image/*;base64,{{doc.parent.partner_id.image_256}}" class="img img-responsive" alt="User Image"/>
Any suggestion?
I got it by myself... thanks Saks_here!
1 - enter developer mode
2 - Menu Technical/User Interface/Views
3 - Find the views you need to duplicate (in my case report_saleorder and report_saleorder_document)
4 - Enter on the view and click in Action/Duplicate and change the "view name" on the top of the screen and laso the t-name on the Archetecture
5 - Menu Technical/Sequence & Identifiers/External Identifires
6 - Find the External Idendifiers you want to duplicate (i used a new browser tab to facilitate copy and paste the info)
7 - Click on Create and views, changing the "external identifier" to the name you need
8 - using a database query, find the id of the views you have created on step 4
9 - go back to the identifiers you have cretaed and replace the "record id" with the id you got on step 8
10 - Menu Technical/Actions/Reports
11 - CLick on the report you want to duoplicate
12 - Click in Action/Duplicate and chenge: Name, Template Name and Printed Report Name and save it
13 - click in Qweb views, you will finde the reports you have created
14 - modify the reports using the archtecture tab
In sale, while clicking on partner_id, you will have partner's name and its parent company's name. If you want to show the logo of parent company in sale Quotation or order report,
Code:
<img style="height:2cm;width:2cm;" t-if="doc.partner_id.parent_id.image_256" t-attf-src="data:image/*;base64,{{doc.partner_id.parent_id.image_256}}" class="img img-responsive" alt="User Image"/>

React Native Step Progress Bar

I need help how can I create progress bar like in the image below, I don't need code just an a idea how to create vertical lines? I already tried with react-native-svg package but I failed. Thanks
progress bar
I have an array like [200, 500, 800, 1200, 2000] for example and I need to create a progress bar that will display those values and also if user have for example 250 points between 200 - 500 step I need to create those vertical lines. This progress bar I am displaying on screen like a information for that user how much points does he have and how many points he need to earn to get to the next step (500 in the example above.)
I didn't have a code, because I had no idea how to create vertical lines. But I got them work using this code
<Svg height={'100%'} width={width} style={styles.someStyle}>
<Line x1="0" y1="10" x2="100%" y2="10" stroke="url(#grad)" strokeWidth="100%" strokeDasharray={`${segmentWidth} ${gapWidth}`} />
<Line x1="0" y1="10" x2="100%" y2="10" clipPath="url(#clip)" stroke={'green'} strokeWidth="100%" strokeDasharray={`${segmentWidth} ${gapWidth}`} />
</Svg>
I am getting steps from the backend and between steps I need to create vertical lines dynamically based on user points like in the image.

How do i make and attache action to button

Hello I have created a button on my Odoo 10 form "SET geprint" now i want to attach an action to the button. If i press the button the value of the boolean geprint must change to 1. How can I make this possible?
If possible i would also like to create that button in the list view to update multiple records.
Thx for your help
I tried your code but i am getting the following error now
(name field to update is x_geprint)
button code :
You can do it via following methods.
Create object type of button in form view. you can give button type="object", after that when you click on button then system will call python method In which you can write your code.
ex:
<button name="validate" string="Validate" type="object" states="draft" class="oe_highlight"/>
#api.multi
def validate(self):
self.write({})
return True
For the list view you need to create new wizard, In which you can select number of records from list view and in list view Action select your wizard name item.
Ex:
from openerp import models, fields, api, _
class test(models.TransientModel):
_name = 'test.test'
<act_window name="Name String" res_model="wizard.model"
src_model="source.model" view_mode="form" view_type="form"
target="new" multi="False"
id="your_id"
view_id="view_id"
context="{}"/>
In source model Action menu you can select wizard link and In the wizard you will get active_ids in context.
active_ids means all list-view selected records, based on that you can do it any operations with selective records.
This may help you.
Make a server action (settings - > technical - > Server actions)
After that search for the action number in your link please see image (my number is 638)
Then go to the form where you want to add the button. In my example its stock.move
Go into edit formview and add the following code
<button name="638" string=" Set geprint" type="action" />

how to make complete 100% row(device width) inside col-lg-3 using bootstrap

[here i have 2 scenarios, 1) first is image one. there i have 4 cards in a each row(that will change based on screen size 4->2->1). it is in respective classes like col-lg-3 col-md-6 col-sm-6 col-xs-12, i have only one html markup to render the card, many cards are displaying dynamically based on back end data.
2) on clicking button in a each card, their respective extra details will come up in bottom to that in complete row.
here problem is since it is in column class, that extra details occupying only that much space(like parent div), i want that in single row. 1)http://i.stack.imgur.com/d8xEC.jpg 2) http://i.stack.imgur.com/N8ewg.jpg]1
because it's too long, i created a fiddle: https://jsfiddle.net/gxyud676/1/
I'm not too happy with that solution, as it is not responsive.
my first thought was to just use the bootstrap collapsable features to use the cards as collapsible triggers, and place the preview markup outside the rows.
but this approach would open the preview on a xs screen always below the 4th element:
CARD 1
CARD 2 <-- clicking
CARD 3
CARD 4
PREVIEW for 2
CARD 5
CARD 6
...
my fiddle solution was then to detect the screen size (hence the number of used cols) and to move the preview markup to the correct position.
another way could be to duplicate the preview markup on the correct positions (for card 1 there is the preview with class "col-xs-12 visible-xs" just after the card, and the same object with "col-sm-6 col-md-6 visible-sm visible-md" after an evenly positioned card and with "visible-lg" after the current row)
it's more complicated than I initially thought :-/

I want to display all the comments of one particular product in magento

I want to display all the comments of one particular product in magento. For example for Each Product it have to show the comments of that particular product only.
If you want to display the Reviews on the product page you can use the code below:
Step 1. You have to edit the catalog.xml file you can find it by navigating to the app/design/frontend/YourPackage/YourTheme/layout/catalog.xml
Step 2. Add this block under the catalog_product_view
<block type="review/product_view_list" name="product.info.product_additional_data" as="product_review" template="review/product/view/list.phtml">
</block>
Step 3. Now call this particular block into the view.phtml page you can find it by navigating to the app/design/frontend/YourPackage/YourTheme/template/catalog/product/view.phtml
Step 4. Add this chunk of the code where you want to display the review on this page
<?php echo $this->getChildHtml('product_review') ?>
That's it hope it helps.
Thanks