Hi Aditya,
cur_frm.toggle_field(“fieldname”, false) will hide the field :)
Essentially it sets the hidden property of the field to true.
body{font-family:Helvetica,Arial;font-size:13px}body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
padding:1em;
margin:auto;
background:#fefefe;
}
h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}
h1 {
color: #000000;
font-size: 28pt;
}
h2 {
border-bottom: 1px solid #CCCCCC;
color: #000000;
font-size: 24px;
}
h3 {
font-size: 18px;
}
h4 {
font-size: 16px;
}
h5 {
font-size: 14px;
}
h6 {
color: #777777;
background-color: inherit;
font-size: 14px;
}
hr {
height: 0.2em;
border: 0;
color: #CCCCCC;
background-color: #CCCCCC;
}
p, blockquote, ul, ol, dl, li, table, pre {
margin: 15px 0;
}
a, a:visited {
color: #4183C4;
background-color: inherit;
text-decoration: none;
}
#message {
border-radius: 6px;
border: 1px solid #ccc;
display:block;
width:100%;
height:60px;
margin:6px 0px;
}
button, #ws {
font-size: 12 pt;
padding: 4px 6px;
border-radius: 5px;
border: 1px solid #bbb;
background-color: #eee;
}
code, pre, #ws, #message {
font-family: Monaco;
font-size: 10pt;
border-radius: 3px;
background-color: #F8F8F8;
color: inherit;
}
code {
border: 1px solid #EAEAEA;
margin: 0 2px;
padding: 0 5px;
}
pre {
border: 1px solid #CCCCCC;
overflow: auto;
padding: 4px 8px;
}
pre > code {
border: 0;
margin: 0;
padding: 0;
}
#ws { background-color: #f8f8f8; }
table {
border-collapse: collapse;
font-family: Helvetica, arial, freesans, clean, sans-serif;
color: rgb(51, 51, 51);
font-size: 15px; line-height: 25px;
padding: 0; }
table tr {
border-top: 1px solid #cccccc;
background-color: white;
margin: 0;
padding: 0; }
table tr:nth-child(2n) {
background-color: #f8f8f8; }
table tr th {
font-weight: bold;
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }
table tr td {
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }
table tr th :first-child, table tr td :first-child {
margin-top: 0; }
table tr th :last-child, table tr td :last-child {
margin-bottom: 0; }
.send { color:#77bb77; }
.server { color:#7799bb; }
.error { color:#AA0000; }
On 24 April 2014 at 4:46:22 pm, Aditya Duggal (ad…@gmail.com) wrote:
Hi,
I would like to know if there is a way to hide a field
irrespective of the fields current state (hidden or unhidden). The
current toggle.display command only lets us change the display
state and you can never be sure whether the item is being displayed
or not.
Is there a command on client side script that I can use to
explicitly hide or make mandatory certain fields.
I have checked the client side scripting help page and could
not find anything there :(
On Saturday, May 4, 2013 2:31:53 PM UTC+5:30, rushabh wrote:
Aditya,
You can update explicitly using the update query in Server
Custom Script of Tool Type. Joins are not bad if you are joining
once or twice :)
best,
Rushabh
On Fri, May 3, 2013 at 7:45 PM, Aditya
Duggal
<ad...@gmail.com>
wrote:
Hi
Anand,
I am using this in my print format:
<script>"<img src='" + doc.dim_image_list + "'
style='width: 500px; height: 250px'/>"</script>
Also I am getting this field from the server side scripting by the
below code:
self.doc.dim_image_list = webnotes.conn.get_value("File Data",
{"attached_to_doctype": "Tool Type", "attached_to_name":
self.doc.tool_type}, "file_url")
But the problem is that if I change the image in the TOOL TYPE the
effects would not reflect until I edit and save an item. Is there
any way I could get the updated image on the print format of an
item as soon as the image on the TOOL TYPE is CHANGED or do I have
to do a UPDATE of the DB from the SYSTEM CONSOLE every time I
change the image and if that is the only thing possible then should
this code work on the backend:
webnotes.conn.sql("UPDATE `tabItem` SET dim_image_list = `tabFile
Data`.file_url WHERE `tabFile Data`.attached_to_doctype = 'Tool
Type' AND `tabFile Data`.attached_to_name =
`tabItem`.tool_type")
But I guess this is wrong since I would need to join the tables and
honestly the JOINS scare the hell out of me since I tried it once
and you all were forced to throw my account out of erpnext (just
joking).
Hence I request you to kindly let me know how to join the 2 tables
or is there a better way to get the updated image
automatically.
On Friday, April 26, 2013 8:17:20 PM UTC+5:30, Anand Doshi wrote:
Hi Aditya,
You can put that in the style attribute of img.
<script>"<img src='" +
doc.tool_type_image + "' style='width: 200px; height: 100px'
/>"</script>
Thanks,
Anand.
Thanks rushabh,
It works perfectly. Just one more thing how could I add the
height and width to control those things. I tried various combos
but none seems to work.
On Friday, April 26, 2013 5:22:32 PM UTC+5:30, rushabh wrote:
Aditya,
webnotes.client.get_value is a server side function.
You will need the value (tool_type_image) in your current
transaction using add_fetch
Then use an image tag like:
<script>"<img src='" + doc.tool_type_image + "'
/>"</script>
This should work...
best,
Rushabh
Hi,
I need to pull an image in a print format from a different
doctype. I have tried using this
<script>webnotes.client.get_value("Tool Type",
doc.tool_type, "image")</script>
But this is not helping me out can you suggest a code hidden
in the client side so that I could fetch a photo attached to a
doctype.
On Friday, April 19, 2013 2:37:39 PM UTC+5:30, Addy wrote:
Hi Anand,
Thanks you very much for the NO COPY code it should solve a
lot of problems for me. As for the file list I can definitely wait
and I guess I would be letting it sleep till the time new release
are made and as for the image placeholder I think Umair gave me a
very simple solution of opening the attachment which I don't know
why I did not think of and hence I guess the placeholder part is
also done.
Once again thanks a lot for all the help you people have been
offering.
To view this discussion on the web visit
https://groups.google.com/d/msg/erpnext-developer-forum/-/BkXD_-W0XSkJ.
To view this discussion on the web visit
https://groups.google.com/d/msg/erpnext-developer-forum/-/l5aLqqc7RxwJ.
To view this discussion on the web visit
https://groups.google.com/d/msg/erpnext-developer-forum/-/zmnrZm82ih8J.
--
--
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/8353f8d1-b835-4529-ab61-0d404c4228da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
–
Note:
If you are posting an issue,
- 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.
- Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
- 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/etPan.53590ed4.515f007c.1e2%40apdmacbook.local.
For more options, visit https://groups.google.com/d/optout.