table.file() return undefined but files attribute in my ajax.json is no problem

table.file() return undefined but files attribute in my ajax.json is no problem

bobobobobobo Posts: 24Questions: 9Answers: 1

How to re-produce?
1 The image in table display normally when refresh the page
2 Then enter add page and upload a new image, no problem here.
3 Click "Save", report an error indicated in my attachment

I printed the result of table.ajax.json, the files attribute is normal, but table.file(...) return "undefined" by pass a valid file Id.

Could you help me? Thanks

Answers

  • allanallan Posts: 61,656Questions: 1Answers: 10,094 Site admin

    Can you link to a page showing the issue so I can debug it please?

    Thanks,
    Allan

  • bobobobobobo Posts: 24Questions: 9Answers: 1

    This is Chinese website, I will show how to go to the page step by step.

    http://115.28.172.106/resources/jy/jiayuan/jyadmin/home-adv.html
    1 login and password : admin/123 The first button is login button.
    2 Click the second button("页面设置"), then the first button("页面广告") in left navigation, you will see the table.
    3 Click create button("新增"), try to create a new record.
    4 Upload image and make sure set value for the select component due to it is mandatory attribute.
    5 Then click "确定" to commit, you will see the error in console log

  • allanallan Posts: 61,656Questions: 1Answers: 10,094 Site admin

    Thanks for the link!

    It looks like the server isn't returning all of the information required for the files when the image is uploaded. I notice you are using Editor 1.5.5. Could you try updating to Editor 1.5.6, including the PHP / .NET libraries if you are using either of them please?

    Is it the PHP or .NET libraries you are using, or a custom script?

    Thanks,
    Allan

  • bobobobobobo Posts: 24Questions: 9Answers: 1

    OK, Let me try. Thanks

  • bobobobobobo Posts: 24Questions: 9Answers: 1

    I am not using PHP or .NET libraries

  • allanallan Posts: 61,656Questions: 1Answers: 10,094 Site admin

    Thanks for the clarification. In that case I think the issue is that on upload you are currently only returning the information about the file that has just been uploaded. Currently (Editor 1.5.x) you need to return all available files.

    That is something that will be addressed in 1.6, but currently you must return all files.

    Allan

  • bobobobobobo Posts: 24Questions: 9Answers: 1

    Thanks Allan

    Is the version 1.6 you mentioned 1.5.6?

    It works also by below way, fetch from ajax.json instead of file function

    homeAdv_table.ajax.json().files.images[file_id].web_path

    Gavin

  • allanallan Posts: 61,656Questions: 1Answers: 10,094 Site admin

    No 1.6 is currently unreleased - I expect to be able to release it in about two months time. 1.5.6 is the current release.

    Regards,
    Allan

This discussion has been closed.