300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > jeecg3.5中实现从一个页面跳转到另一个页面【HTML】

jeecg3.5中实现从一个页面跳转到另一个页面【HTML】

时间:2023-08-10 03:05:53

相关推荐

jeecg3.5中实现从一个页面跳转到另一个页面【HTML】

web前端|html教程

jeecg3.5中实现从一个页面跳转到另一个页面

web前端-html教程

实现以下效果

李逵劈鱼辅助源码,ubuntu查看编码格式,tomcat有mac版本吗,硬壳爬虫图片,php高级开发 吾爱破解,seo想你lzw

点”跳转到demo”后直接跳转到demo示例,并且带上查询条件,如下:

防红网站源码,Ubuntu查看本机用户,阿里云宝塔启动tomcat,博康爬虫,php在线学习表格教程,小寒seolzw

由于jeecg使用的是easyui,所以不能直接用类似于这样的方式来跳转了,但还是有办法做到的,首先在\plug-in\accordion\js\left_shortcut_menu.js中增加以下代码:

秒表jquery源码,ubuntu 文字无颜色,爬虫还原网页结构,中文php ide,重庆可靠seolzw

function goToTab(subtitle, url, icon) {// begin author:屈然博 -7-12 for:解决firefox 点击一次请求两次的问题var progress = $("div.messager-progress");if(progress.length){return;}// begin author:屈然博 -7-12 for:解决firefox 点击一次请求两次的问题rowid="";$.messager.progress({text : loading,interval : 200});if (!$(#maintabs).tabs(exists, subtitle)) {//判断是否进行iframe方式打开tab,默认为href方式if(url.indexOf(isHref) != -1){$(#maintabs).tabs(add, {title : subtitle,href : url,closable : true,icon : icon});}else{$(#maintabs).tabs(add, {title : subtitle,content : \,closable : true,icon : icon});}} else {$(#maintabs).tabs(select, subtitle);if(url.indexOf(isHref) != -1){$(#maintabs).tabs(update, {tab : $(#maintabs).tabs(getSelected),options : {href : url}});} else {$(#maintabs).tabs(update, {tab : $(#maintabs).tabs(getSelected),options : {content : \}});}$.messager.progress(close);}// $(#maintabs).tabs(select,subtitle);tabClose();}

这个方法实际上基本上都是抄原来的addTab方法,就是在如果原来已经打开tab的情况下用update的方式来更新tab。

然后在需要跳转到其它页面的地方增加以下代码,以jeecgNoteList.jsp为例:

对应的js:

function toDemo() { var url = "jeecgDemoController.do?jeecgDemo&selectedParams=" + encodeURIComponent("{\"sex\":0,\"createDate_begin\":\"-03-28\",\"createDate_end\":\"-04-14\"}"); window.parent.goToTab(Demo示例,url,default) }

注意要用encodeURIComponent方法对链接进行处理,否则如果链接中带有特殊字符如引号的话不处理是无法正常传递参数的。

然后在目标界面增加以下代码,以jeecgDemoList.jsp为例:

$(function() {init();});function init() {//alert($(#jeecgDemoList));var href = decodeURIComponent(window.location.href);//alert(href);var idx = href.indexOf(selectedParams);if (idx != -1) {idx = href.indexOf("{", idx);if (idx != -1) {var endIdx = href.indexOf("}", idx);if (endIdx != -1) {var selectedParams = href.substring(idx, endIdx + 1);var jsonParam = $.parseJSON(selectedParams);$(#jeecgDemoListtb).find(*).each(function() {if (jsonParam[$(this).attr( ame)] != undefined) {if ($(this)[0].tagName == "SELECT") {//$(this).attr("value", "0");$(this).val(jsonParam[$(this).attr( ame)]);} else if ($(this)[0].tagName == "INPUT") {$(this).val(jsonParam[$(this).attr( ame)])}}});}}}jeecgDemoListsearch();}

注意其中的jeecgDemoList类似的字眼因为是jeecg生成的,所以需要根据实际情况修改成实际的值。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。