JavaScript ,Css and Jquery In OpenERP 7.0
From: http://openerpbay.blogspot.jp/2013/02/javascript-css-and-jquery-in-openerp-70.html
Hi fellows,
Here i'm showing how can you use JavaScript ,Css and Jquery In OpenERP 7.0.There is one cool feature added in openERP 7.0 in which you can use HTML tags inside openERP form view. This feature is not available in older version (Web 6.0 , 6.1). OpenERP already use HTML codes like <div> <H1> inside form view. But you can do much more than that you can use css and JavaScript inside form view code (OpenERP XML Code). Even more you can use JQuery also In Form View but JQuery is only work if you have old OpenERP 7 Web.In next few weeks i will show you how jquery also used in latest OpenERP 7.0 Web Code.
Now, let's see how use this thing in form view. It is very if you have little knowledge of CSS and JavaScript. You can apply css as like you apply css in HTML code but only different is here you apply css in openerp form code.
CSS
In HTML we use css(inline) like this- Same like you can apply in OpenERP-
<p style="color:sienna;font-size:8pt;"></p>
<field name="product_id" style="color:sienna;font-size:8pt;"/>
(This will apply css on that field but only if it in readonly form or it is in saved state.)
JavaScript
For JavaScript you can define script anyplace in code whare you can use HTML Tags.
<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.normal.form</field>
<field name="model">product.product</field>
<field name="arch" type="xml">
<form string="Product" version="7.0">
<sheet>
<script>
alert("Hi I'm JavaScript :P ");
</script>
<field name="image_medium" widget="image" class="oe_avatar oe_left"/>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name" string="Product Name"/>
</div>
<h1>
<field name="name"/>
</h1>
............
............
JQuery
For JQuery you need to apply your JQuery code inside script tag same as JavaScript. But this is not working in latest code.
<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.normal.form</field>
<field name="model">product.product</field>
<field name="arch" type="xml">
<form string="Product" version="7.0">
<sheet>
<script>
$(document).ready(function(){
$(".oe_edit_only").click(function(){
$(this).hide();
});
});
</script>
<field name="image_medium" widget="image" class="oe_avatar oe_left"/>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name" string="Product Name"/>
</div>
<h1>
<field name="name"/>
</h1>
............
............
Have a good day.
Save Paper, Save Trees.
JavaScript ,Css and Jquery In OpenERP 7.0的更多相关文章
- Javascript Fromdata 与jQuery 实现Ajax文件上传以及文件的删除
前端HTML代码: <!DOCTYPE html> <html> <head> <title>ajax</title> <script ...
- Javascript Fromdata 与jQuery 实现Ajax文件上传
<!DOCTYPE html> <html> <head> <title>ajax</title> <script type=&quo ...
- html css+div+jquery实现图片轮播
一直想自己动手做一个图片轮播的控件,查查网上的资料大多引用已经做好的组件,其原理算法不是很清楚,于是自己用jquery写了一个.先看下效果图: 主要界面实现思路如下: 1.新建一个div宽度为100% ...
- 动态加载js和css的jquery plugin
一个简单的动态加载js和css的jquery代码,用于在生成页面时通过js函数加载一些共通的js和css文件. //how to use the function below: //$.include ...
- jQuery plugin: Tablesorter 2.0
http://mottie.github.io/tablesorter/docs/example-pager.htmlhttp://tablesorter.com/docs/example-pager ...
- css与jquery、图标字体
*)还能这样选择 header #search input[type="text"] *)按钮常用颜色:#008cBA(字母大小写没有区别) *)清除浮动后,text-align没 ...
- JavaScript进阶内容——jQuery
JavaScript进阶内容--jQuery 我们在前面的文章中已经掌握了JavaScript的全部内容,现在让我们了解一下JavaScript库 这篇文章主要是为了为大家大致讲解JavaScript ...
- CSS与JQuery的相关问题
文字隐藏:p div里面的文字过长时隐藏文字: overflow:hidden; text-overflow:ellipsis; white-space:nowrap; --------------- ...
- 使用CSS和jQuery实现对话框
因为项目中要显示一些对话框,但用alert显得太丑,后从网上找了一些插件,但有觉得不好用,因此自己试用CSS和jQuery写了一个对话框,代码如下: <!DOCTYPE html> < ...
随机推荐
- 所以学树分块的时候为什么要看vector啊sjb
明明应该拼命刷题却悠哉补着vector和指针 -------------------------------------------------------------------题记 http:// ...
- HDU 5514 Frogs(容斥原理)
[题目链接] http://acm.hdu.edu.cn/showproblem.php?pid=5514 [题目大意] m个石子围成一圈,标号为0~m-1,现在有n只青蛙,每只每次跳a[i]个石子, ...
- jdk1.6,jdk1.7和jdk1.8多版本切换
目录 一.配置jdk1.7(win7系统) 二.jdk1.8切换回jdk1.7 三.最后强调可能出现不成功的原因 首先要明确jdk一般都是默认安装在C:\Program Files\Java下的,在配 ...
- Loj10170骑士
试题描述 在 n×n(1≤n≤10)的棋盘上放 k(0≤k≤n)个国王(可攻击相邻的8个格子),求使它们无法互相攻击的方案总数. 输入 输入有多组方案,每组数据只有一行为两个整数n和k. 输出 每组数 ...
- python3.5: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory
python3.5安装报错 python3.5: error while loading shared libraries: libpython3.5m.so.1.0: cannot open sha ...
- Spring---介绍
核心容器:Core.Beans.Context.EL模块 1. Core模块:封装了框架依赖的最底层部分,包括访问资源.类型转换及一些常用工具类 2. Beans模块:提供了框架的基础 ...
- Educational Codeforces Round 10 B. z-sort 构造
B. z-sort 题目连接: http://www.codeforces.com/contest/652/problem/B Description A student of z-school fo ...
- PAT甲级1033. To Fill or Not to Fill
PAT甲级1033. To Fill or Not to Fill 题意: 有了高速公路,从杭州到任何其他城市开车很容易.但由于一辆汽车的坦克容量有限,我们不得不在不时地找到加油站.不同的加油站可能会 ...
- php图片上传检测是否为真实图片格式
PHP 图片上传,如果不做任何判断的话,随便一个文件如 rar,zip,php,java等文件改个文件名,改个后缀就能以图片形式上传的服务器,往往会造成极大的危害! 工具/原料 PHP apach ...
- Upgrading Directly from MySQL 5.0 to 5.7 using an ‘In Place’ Upgrade
http://mysqlserverteam.com/upgrading-directly-from-mysql-5-0-to-5-7-using-an-in-place-upgrade/