Mobile – The best way to dynamically add more fields to the form

I have a form for the user to issue an invoice, it is essentially composed of comboboxes and 90% of the time he will send the receipt with a single product, but rarely will he send it with more from one, my question is what is the "best way" I can add a button or something so that the user can add (and delete) more products to the receipt.

My current form:

enter the description of the image here

How to add a menu item in the Ariane thread only on specific dynamically created pages

I've put the breadcrumbs to appear only on bbpress and buddypress. In the bbpress section, the Ariane thread looks like this:

Home> FTBMates> Q & A

… where & # 39; FTBMates & # 39; is the root of my forum.

Meanwhile in Buddypress, the Ariane thread looks like this:

Home> Members> User Name

I would like to add "FTBMates" in the Ariane thread before "Members", so it looks like this:

Home> FTBMates> Members> User Name

I would like this additional FTBMates element to be added to every page of Buddypress.

I found a code that claims to do it for me:

add_filter('bcn_after_fill', 'my_static_breadcrumb_adder');
function my_static_breadcrumb_adder($breadcrumb_trail) {
if($breadcrumb_trail->breadcrumbs(count($breadcrumb_trail->breadcrumbs)-2)->get_id() === 5450){
    $new_breadcrumb = new bcn_breadcrumb('Rental', NULL, array('rental'), '/rental/');
    array_splice($breadcrumb_trail->breadcrumbs, -1, 0, array($new_breadcrumb));
}
}

The problem is that some pages of Buddypress, like the member profile page, for example, are dynamically created so that I can not replace the get_id part of this code (if I understood it correctly).

Can there be any code to add to my functions.php file that will add this item to my breadcrumbs only in the buddypress section of my website?

java – Android: fills a data from the server to spinner dynamically

I am new to Android programming. So, basically, I want to get some data from the server and populate it dynamically in my spinner view. I was able to receive data and display the name on my spinner, but I can not display the updated data on my spinner.

Here is my code:

Spinner spin;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.popup);

    /** an ID for the spinner **/
    spin = (Spinner) findViewById(R.id.spinner);

        // This is the json string returned from server.
     String jsonString = "{"topic": "/waypoints", "msg": {"waypoints": ({"header": {"stamp": {"secs": 0, "nsecs": 0}, "frame_id": "map", "seq": 0}, "pose": {"position": {"y": -140.901899144836, "x": 44.36469369653882, "z": 0.0}, "orientation": {"y": 0.0, "x": 0.0, "z": 0.5062775131960053, "w": 0.8623706161692133}}, "name": "A"}, {"header": {"stamp": {"secs": 0, "nsecs": 0}, "frame_id": "map", "seq": 0}, "pose": {"position": {"y": -102.30524463734227, "x": 51.282396271771304, "z": 0.0}, "orientation": {"y": 0.0, "x": 0.0, "z": 0.6926372547579506, "w": 0.721286096719859}}, "name": "B"})}, "op": "publish"}";

        // This will convert the json string to list of WayPoint
    List wayPoints = getWayPointListFromJsonString(jsonString);

        // Create adapter for spinner
    SpinnerAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, wayPoints);
    spin.setAdapter(adapter);
    spin.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView parent, View view, int p, long id) {
            WayPoint wayPoint = (WayPoint) parent.getItemAtPosition(p);

            // Process position here
            WayPoint.Position position = wayPoint.pose.position;

            // Process orientation here
            WayPoint.Orientation orientation = wayPoint.pose.orientation;
            }

        @Override
        public void onNothingSelected(AdapterView parent) {
        }
    });

}

/**
 * A method to parse a jsonstring to waypoint list
 **/
private List getWayPointListFromJsonString(String json) {
    List wayPoints = new ArrayList<>();


    try {
        JSONObject jsonObject = new JSONObject(json);
        JSONArray wayPointJsonArray = jsonObject.getJSONObject("msg").getJSONArray("waypoints");
        for (int i = 0; i < wayPointJsonArray.length(); i++) {
            JSONObject wayPointJsonObject = wayPointJsonArray.getJSONObject(i);
            // Parse name
            String name = wayPointJsonObject.getString("name");

            // Parse pose to get position and orientation;
            JSONObject poseJsonObject = wayPointJsonObject.getJSONObject("pose");

            // Parse position form pose
            JSONObject positionJsonObject = poseJsonObject.getJSONObject("position");
            WayPoint.Position position = new WayPoint.Position();
            position.x = positionJsonObject.getDouble("x");
            position.y = positionJsonObject.getDouble("y");
            position.z = positionJsonObject.getDouble("z");

            // Parse orientation from pose.
            JSONObject orientationJsonObject = poseJsonObject.getJSONObject("orientation");
            WayPoint.Orientation orientation = new WayPoint.Orientation();
            orientation.x = orientationJsonObject.getDouble("x");
            orientation.y = orientationJsonObject.getDouble("y");
            orientation.z = orientationJsonObject.getDouble("z");
            orientation.w = orientationJsonObject.getDouble("w");

            WayPoint.Pose pose = new WayPoint.Pose();
            pose.position = position;
            pose.orientation = orientation;

            WayPoint wayPoint = new WayPoint();
            wayPoint.name = name;
            wayPoint.pose = pose;
            wayPoints.add(wayPoint);


        }
    } catch (JSONException e) {
        e.printStackTrace();
    }

    return wayPoints;
}

java – Android: dynamically fills the data of a server.

I am new to Android. How do you dynamically fill a spinner from the server data?

This is my Spinner layout:


Thanks in advance!

8 – Load block content dynamically / via AJAX?

I need a custom block on the page (which will be the entire site) and that has two states: one for when a cookie is present and has some value and l & # 39; Other for the moment when this cookie does not exist or when the value is obsolete. Think of it as login states, but not authentication via Drupal.

What is the proper way to proceed with the block build () method? Do I need to implement a lazy loader containing the logic that builds the rendering array? Do I also add a cache context based on this cookie and its value so that it is unique for these users?

importrange – Google sheets: Dynamically reference data from multiple tabs and sort them

I have a spreadsheet with multiple tabs of data, the data contains 2 columns, A = Categories, B = Quantity.

I have created a copy of the worksheet HERE (please use File> Copy) if you want to have a copy of the file to edit.

I want to reference all the data in a "master sheet", then sort them. But I want the data to be referenced for example. if this changes in the original tab, the "master sheet" should also be updated.

Currently, I have tried to do this in 3 ways:

Option 1) reference all data in the master tab using =Sheetname!B2 and repeat for each sheet. It works to display all the data on a page, but once the data is there, it does not allow me to sort it.

Option 2) reference all the data in the master tab with the help of =Sheetname!B2 and repeat for each sheet. Then create a PivotTable from the main tab. It works and allows me to sort, but only sorts the quantity in each category. Not like a complete list.

Option 3) The only way that this works up to now is to do option 1, but then copy the data and paste it as values, it works, but is no longer referenced in a dynamic way.

Is there another way to dynamically reference all data and sort them?

javascript – Deleting table data dynamically with Axios

I have a Reactjs application that displays a table that returns data from an API via GET and a form that inserts data into the table via POST with the help of Axios.

In each line is displayed a button, I would like that when the button was clicked, the row of the respective table was deleted and made DELETE request to the API.

Here are the table and form codes:

class Form extends React.Component {
constructor(props) {
    super(props)
    this.state = {
        name: '',
        email: '',
        phone: ''
    }

    this.handleSubmit = this.handleSubmit.bind(this)
    this.handleChangeName = this.handleChangeName.bind(this)
    this.handleChangeEmail = this.handleChangeEmail.bind(this)
    this.handleChangePhone = this.handleChangePhone.bind(this)
}

handleChangeName = (event) => {
    this.setState({
        name: event.target.value
    })
}

handleChangeEmail = (event) => {
    this.setState({
        email: event.target.value
    })
}

handleChangePhone = (event) => {
    this.setState({
        phone: event.target.value
    })
}    

handleSubmit = (event) => {       
    event.preventDefault()        
    const {name, email, phone} = this.state

    axios.post('https://jsonplaceholder.typicode.com/users', { name, email, phone })
    .then((res) => {
        console.log(res)
        console.log(res.data)

        const table = document.getElementById("myTable")        
        const row = table.insertRow(-1)   

        const cell1 = row.insertCell(0)
        const cell2 = row.insertCell(1)
        const cell3 = row.insertCell(2)
        const cell4 = row.insertCell(3)
        const cell5 = row.insertCell(4)
        cell1.innerHTML = '' + res.data.id + '' 
        cell2.innerHTML = res.data.name
        cell3.innerHTML = res.data.email
        cell4.innerHTML = res.data.phone
        cell5.innerHTML = '' 
    })

    document.getElementById('form-api').reset() 

    const MySwal = withReactContent(Swal)
    MySwal.fire({
        title: 

Hello World

, footer: 'Copyright 2018', onOpen: () => { MySwal.clickConfirm() } }) .then(() => { return MySwal.fire( 'Muito bem!', 'Você cadastrou um usuário na tabela!', 'success' ) }) } render() { return (

CRUD with ReactJS

Cadastro de usuários

) }

}

Default export form

class Table extends React.Component {
constructor() {
    super()
    this.state = {
      usersData: ()
    }
}

  componentDidMount() {
    axios.get('https://jsonplaceholder.typicode.com/users')
    .then((res) => {
      this.setState({
        usersData: res.data
      })
    })
  }

  deleteUser = () => { 
    /*axios.delete('https://jsonplaceholder.typicode.com/users/')
      .then((res) => {
        console.log(res)
        console.log(res.data)
    })*/      
  }

  render() {
    const usersData = this.state.usersData;

    return (
      
{usersData.map((value) => ( ))}
ID Nome Email Telefone
{value.id} {value.name} {value.email} {value.phone}
) }

}

Default export table

workflow – Dynamically attach to the lists created by the site design

I have a site design, which adds a SharePoint list with a few columns. I need the ability to select an item from this list / library, click on Feed, choose my feed and run it.

The case I have is that the sites will be created by the users and that the design of the site will be applied to them to create these lists. Is there a way to link the feed to these newly created lists so that the feed appears in the feed list and binds it dynamically to it?

pointers – dynamically allocate a 2D array in C

I understood the code but explain what is int *arr = (int *)malloc(r * c * sizeof(int)); More precisely malloc(r* c*) part.

#include  
#include  

int main() 
{ 
    int r = 3, c = 4; 
     /*Explain this Code please! */
    int *arr = (int *)malloc(r * c * sizeof(int)); 

    int i, j, count = 0; 
    for (i = 0; i <  r; i++) 
      for (j = 0; j < c; j++) 
         *(arr + i*c + j) = ++count; 

    for (i = 0; i <  r; i++) 
      for (j = 0; j < c; j++) 
         printf("%d ", *(arr + i*c + j)); 

   /* Code for further processing and free the  
      dynamically allocated memory */

   return 0; 
}