How to access div inside Document Field

Hi all,

I have added one custom field 'ABC' of Field Type 'HTML' on doctype Quotation. In the "Options" of that field i have written code <div style="width:100%" id="dynamic"></div>

On load, i have to fetch that div using id 'dynamic' and append a table to that div
My code is,

$("#dynamic").html('<table style="width:100%;overflow:none" class="display" id="datatable"><tr><td>Test Data</td></tr></table>') 

It is not working.
Is there any another way to access the div(id='dynamic') which is assigned to field 'ABC' ? please provide the solution

Thanks, Rohit



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ce12519f-fd2c-4bdc-9ce2-af52dc9a5067%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Use refresh event and not onload.

-Anand.


On Wed, Jul 16, 2014 at 11:10 AM, Rohit Waghchaure <ro...@indictranstech.com> wrote:
Hi all,

I have added one custom field 'ABC' of Field Type 'HTML' on doctype Quotation. In the "Options" of that field i have written code <div style="width:100%" id="dynamic"></div>

On load, i have to fetch that div using id 'dynamic' and append a table to that div
My code is,

$("#dynamic").html('<table style="width:100%;overflow:none" class="display" id="datatable"><tr><td>Test Data</td></tr></table>')

It is not working.
Is there any another way to access the div(id='dynamic') which is assigned to field 'ABC' ? please provide the solution

Thanks, Rohit



Note:



If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ce12519f-fd2c-4bdc-9ce2-af52dc9a5067%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAAQzbF2Aiq09bnwsi5P1-cQ7US-JFTEJVKseGz1V%2BrS1yNAy%3Dw%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Anand,

Still it is not working.

To check the issue, i have added an alert below the actual code.

$("#dynamic").html('<table style="width:100%;overflow:none" class="display" id="data_table"><tr><td>WELCOME to jungle</td></tr></table>')
alert("hii") // to check the issue

I have seen that my first code is working when alert popup show on screen and when i click on ok to close the alert popup the table is not showing in the field.

Please provide the solution

Thanks, Rohit






Regards


On Wed, Jul 16, 2014 at 11:28 AM, Anand Doshi <an...@erpnext.com> wrote:
Use refresh event and not onload.

-Anand.


On Wed, Jul 16, 2014 at 11:10 AM, Rohit Waghchaure <ro...@indictranstech.com> wrote:
Hi all,

I have added one custom field 'ABC' of Field Type 'HTML' on doctype Quotation. In the "Options" of that field i have written code <div style="width:100%" id="dynamic"></div>

On load, i have to fetch that div using id 'dynamic' and append a table to that div
My code is,

$("#dynamic").html('<table style="width:100%;overflow:none" class="display" id="datatable"><tr><td>Test Data</td></tr></table>')

It is not working.
Is there any another way to access the div(id='dynamic') which is assigned to field 'ABC' ? please provide the solution

Thanks, Rohit



Note:



If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ce12519f-fd2c-4bdc-9ce2-af52dc9a5067%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




Note:



If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAAQzbF2Aiq09bnwsi5P1-cQ7US-JFTEJVKseGz1V%2BrS1yNAy%3Dw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Rohit S. Waghchaure
Cell: +91 90118 57174 | Off. : (20) 657 0800 / 25281316
New Indictrans Technologies Pvt Ltd | www.indictranstech.com



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAFsi8V2HoHR5zB6Fw3eYraDjoUGFmJpXD6SWHdam2eo60Q8DYQ%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Rohit,

If the alert is coming up, it means that you jquery has problems. You need to debut this using the console, like checking if $("#dynamic") returns anything, etc.


Thanks,
Anand.


On Wed, Jul 16, 2014 at 11:53 AM, Rohit Waghchaure <ro…@indictranstech.com> wrote:

Hi Anand,

Still it is not working.

To check the issue, i have added an alert below the actual code.

$("#dynamic").html('<table style="width:100%;overflow:none" class="display" id="data_table"><tr><td>WELCOME to jungle</td></tr></table>')
alert("hii") // to check the issue

I have seen that my first code is working when alert popup show on screen and when i click on ok to close the alert popup the table is not showing in the field.

Please provide the solution

Thanks, Rohit






Regards



On Wed, Jul 16, 2014 at 11:28 AM, Anand Doshi <an…@erpnext.com> wrote:

Use refresh event and not onload.

-Anand.


On Wed, Jul 16, 2014 at 11:10 AM, Rohit Waghchaure <ro...@indictranstech.com> wrote:
Hi all,

I have added one custom field 'ABC' of Field Type 'HTML' on doctype Quotation. In the "Options" of that field i have written code <div style="width:100%" id="dynamic"></div>

On load, i have to fetch that div using id 'dynamic' and append a table to that div
My code is,

$("#dynamic").html('<table style="width:100%;overflow:none" class="display" id="datatable"><tr><td>Test Data</td></tr></table>')

It is not working.
Is there any another way to access the div(id='dynamic') which is assigned to field 'ABC' ? please provide the solution

Thanks, Rohit



Note:



If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ce12519f-fd2c-4bdc-9ce2-af52dc9a5067%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




Note:



If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAAQzbF2Aiq09bnwsi5P1-cQ7US-JFTEJVKseGz1V%2BrS1yNAy%3Dw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Rohit S. Waghchaure

Cell: +91 90118 57174 | Off. : (20) 657 0800 / 25281316

New Indictrans Technologies Pvt Ltd | www.indictranstech.com



Note:



If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAFsi8V2HoHR5zB6Fw3eYraDjoUGFmJpXD6SWHdam2eo60Q8DYQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.




Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAAQzbF0ncp%3DmshJRBvmB%3DTjrKaVLZ%3DJGPe2S_-U-3EGS4wFdyg%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.