javascript - iview custom column header display content problem (get on the bus, get ready to leave)
学习ing
学习ing 2017-07-05 10:35:53
0
3
943

Directly upload the picture:

Requirements: Column headers and content are obtained from the returned data;
There is a problem now: when the query result is 7 items, the data can be displayed (as shown in the figure above); but when it is one When it comes to results, there is a problem with parsing;
Code:


The error message is as shown below:

Do you have any ideas?

学习ing
学习ing

reply all (3)
黄舟

In fact, the value obtained from the returned json data is used as the header information. Because the returned data format is the same, the content of the title is the same. We directly intercept the first array returned. The information is OK as the header.

    伊谢尔伦

    You can put yourdata1indata()as a local variable.

      某草草

      The problem is that you changed the data. When your data changed from 7 to 1, your tableColumns still wrote 7. There is no data for day2 in your data. However, the tablecolumns still have not changed. At this time, the rendering Then I will look for the data of day2 and find day2undefinde. The correct method is to dynamically change the tableColumns based on the data in data1

        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!