精华内容
下载资源
问答
  • 主要介绍了EasyUI折叠表格层次显示detailview详解及实例,非常不错,具有参考借鉴价值,需要的朋友参考下吧
  • datagrid-detailview.js下载

    2020-10-08 15:07:46
    easyui的datagridview拓展,使用方法看我的博文,网址:https://blog.csdn.net/qq_30907845/article/details/108963344
  • jquery-easyui的扩展组件jquery-easyui-datagridview,其中的datagrid-detailview.js可方便地生成子网格,但是每行均默认生成展开按钮,实际我们希望对某些行不显示展开按钮,网上很多人提供的解决方案就是通过dom...
  • datagrid-detailview.js

    2018-05-25 09:00:02
    jquery 插件 高性能的js模板引擎 datagrid-detailview.js 反正就是他的插件。
  • datagrid-detailview

    2018-11-28 18:28:52
    easyUI表格镶嵌子表格插件,导入这个js后就可以愉快的使用表格嵌套了
  • 本文我们主要研究了如何使用可选择行的GridView显示主记录,以及在DetailsView中显示选中记录的详细信息。
  • 支持datagrid扩展,在一条记录下面可以嵌套一个子datagrid,切记要在页面中引入该js
  • NULL 博文链接:https://cheen.iteye.com/blog/1914379
  • 本文参考于Django2.2文档 视图函数(或简称视图)只是一个Python函数...使用更少的代码实现功能 以通用显示视图 DetailView 为例: 该视图从以下视图继承方法和属性,MRO顺序: 想了解MRO的具体原理移步我的另一篇博文: ...

    本文参考于Django2.2文档

    视图函数(或简称视图)只是一个Python函数,它接受Web请求并返回Web响应。该响应可以是网页的HTML内容,重定向,404错误,XML文档或图像。。。真的。视图本身包含返回该响应所需的任何任意逻辑。该代码可以存在于您想要的任何地方,只要它在Python路径上即可。可以说,没有其他要求-没有“魔术”。为了将代码放在某处,约定是将视图放在一个名为的文件中views.py,该文件位于项目或应用程序目录中。

    Django有3种视图:

    • 函数视图 FBV
    • 类视图 CBV
    • 通用视图 CBGV

    函数视图 FBV

    通过条件分支来处理不同http请求

    # 函数视图  FBV
    def my_view(request):
    	if request.method == 'GET':
    		return HttpResponse("xxx")
    	elif request.method == 'POST':
    		return HttpResponse("xxx")
    	elif request.method == 'DELETE':
    		return HttpResponse("xxx")
    
    # urls
    from . import views
    urlpatterns = [
        path('', views.my_view, name='index')
    ]
    

    缺点:函数式编程-面向过程,代码复用率低

    类视图 CBV

    继承自View类,通过不同实例方法来响应http请求

    # 面向对象编程
    from django.views.generic import View
    
    class MyView(View):
        def get(self,request,*args,**kwargs):
            pass
        def post(self,request,*args,**kwargs):
            pass
    
    # urls
    from . import views
    
    # 使用as_view()方法,为基于类的视图提供一个类似函数的入口
    urlpatterns = [
        path('', views.MyView.as_view(), name='index')
    ]
    

    通用视图 CBGV

    在类视图上更进一步,把增删改查操作的具体方法抽象出来,使用更少的代码实现功能

    以通用显示视图 DetailView 为例:
    • 该视图从以下视图继承方法和属性,MRO顺序:
      想了解MRO的具体原理移步我的另一篇博文: https://blog.csdn.net/weixin_44955304/article/details/105175789

      DetailView(自身)
      django.views.generic.detail.SingleObjectTemplateResponseMixin
      django.views.generic.base.TemplateResponseMixin
      django.views.generic.detail.BaseDetailView
      django.views.generic.detail.SingleObjectMixin
      django.views.generic.base.ContextMixin
      django.views.generic.base.View

    • 方法流程图在这里插入图片描述

    • 具有(可重写-自定义)的类属性

      属性Defined in
      content_type = NoneTemplateResponseMixin
      context_object_name = NoneSingleObjectMixin
      extra_context = NoneContextMixin
      http_method_names = [‘get’, ‘post’, ‘put’, ‘patch’, ‘delete’, ‘head’, ‘options’, ‘trace’]View
      model = NoneSingleObjectMixin
      pk_url_kwarg = ‘pk’SingleObjectMixin
      query_pk_and_slug = FalseSingleObjectMixin
      queryset = NoneSingleObjectMixin
      response_class = <class ‘django.template.response.TemplateResponse’>TemplateResponseMixin
      slug_field = ‘slug’SingleObjectMixin
      slug_url_kwarg = ‘slug’SingleObjectMixin
      template_engine = NoneTemplateResponseMixin
      template_name = NoneTemplateResponseMixin
      template_name_field = NoneSingleObjectTemplateResponseMixin
      template_name_suffix = ‘_detail’SingleObjectTemplateResponseMixin

    按照Django官方文档所述流程看,通用类视图代码

    1. setup

      def setup(self, request, *args, **kwargs):
      """Initialize attributes shared by all view methods."""
      	self.request = request
          self.args = args
      	self.kwargs = kwargs
      
    2. dispatch()

      def dispatch(self, request, *args, **kwargs):
      	# 当request 请求参数在自定义类属性self.http_method_names中
      	if request.method.lower() in self.http_method_names:
      		# 处理器 = 获取当前类的request.method.lower()值,默认获取值为self.http_method_not_allowed
          	handler = getattr(self, request.method.lower(), self.http_method_not_allowed)
          # 或者请求参数不存在
      	else:
          	handler = self.http_method_not_allowed
          # handler = get/post/delete... 与上文类视图 处理请求类似
      	return handler(request, *args, **kwargs)
      
    3. http_method_not_allowed()

      def http_method_not_allowed(self, request, *args, **kwargs):
          logger.warning('Method Not Allowed (%s): %s', request.method, request.path,
              extra={
                  'status_code': 405,
                  'request': request
              }
          )
          return http.HttpResponseNotAllowed(self._allowed_methods())
      
      def _allowed_methods(self):
          return [m.upper() for m in self.http_method_names if hasattr(self, m)]
      
    4. get_template_names()
      有两个类(SingleObjectTemplateResponseMixin/TemplateResponseMixin )定义了该函数,按照MRO算法,此处使用的是SingleObjectTemplateResponseMixin中定义的get_template_names()

      ps: SingleObjectTemplateResponseMixin类继承自TemplateResponseMixin类

      def get_template_names(self):
      try:
          # 调用父类TemplateResponseMixin中的get_template_names()方法
          names = super().get_template_names()
      except ImproperlyConfigured:
          # If template_name isn't specified, it's not a problem --
          # we just start with an empty list.
          names = []
          # 如果设置了self.template_name_字段,则获取该字段的值
          if self.object and self.template_name_field:
              name = getattr(self.object, self.template_name_field, None)
              if name:
                  names.insert(0, name)
          # 仅当所讨论的对象是模型时才使用此选项
          if isinstance(self.object, models.Model):
              object_meta = self.object._meta
              names.append("%s/%s%s.html" % (
                  object_meta.app_label,
                  object_meta.model_name,
                  self.template_name_suffix
              ))
          elif getattr(self, 'model', None) is not None and issubclass(self.model, models.Model):
              names.append("%s/%s%s.html" % (
                  self.model._meta.app_label,
                  self.model._meta.model_name,
                  self.template_name_suffix
              ))
          # If we still haven't managed to find any template names, we should
          # re-raise the ImproperlyConfigured to alert the user.
          if not names:
              raise
      return names
      
      def http_method_not_allowed(self, request, *args, **kwargs):
      	logger.warning(
          	'Method Not Allowed (%s): %s', request.method, request.path,
          	extra={'status_code': 405, 'request': request}
      	)
      	return HttpResponseNotAllowed(self._allowed_methods())
      
    5. get_slug_field()

      def get_slug_field(self):
      	"""Get the name of a slug field to be used to look up by slug."""
      	return self.slug_field
      
    6. get_queryset()

      def get_queryset(self):
      """
      Return the `QuerySet` that will be used to look up the object.
      This method is called by the default implementation of get_object() and
      may not be called if get_object() is overridden.
      """
      # 如果self.queryset属性 没有自定义
      if self.queryset is None:
      	# 如果定义了 self.model 属性
          if self.model:
          	# 返回模型类的所有查询集(_default_manager代表Model的默认管理器)
              return self.model._default_manager.all()
          else:
              raise ImproperlyConfigured(
                  "%(cls)s is missing a QuerySet. Define "
                  "%(cls)s.model, %(cls)s.queryset, or override "
                  "%(cls)s.get_queryset()." % {
                      'cls': self.__class__.__name__
                  }
              )
      # 返回自定义查询集的 所有查询结果
      return self.queryset.all()
      
    7. get_object()

      def get_object(self, queryset=None):
          """
          返回视图显示的对象。
          在url参数中要求 `self.queryset` and a `pk` or `slug` .
          S子类可以重写此项以返回任何对象。
          """
          # Use a custom queryset if provided; this is required for subclasses
          # like DateDetailView
      
          if queryset is None:
              queryset = self.get_queryset()
          # Next, try looking up by primary key.
          pk = self.kwargs.get(self.pk_url_kwarg)
          slug = self.kwargs.get(self.slug_url_kwarg)
          if pk is not None:
              queryset = queryset.filter(pk=pk)
          # Next, try looking up by slug.
          if slug is not None and (pk is None or self.query_pk_and_slug):
              slug_field = self.get_slug_field()
              queryset = queryset.filter(**{slug_field: slug})
          # If none of those are defined, it's an error.
          if pk is None and slug is None:
              raise AttributeError(
                  "Generic detail view %s must be called with either an object "
                  "pk or a slug in the URLconf." % self.__class__.__name__
              )
          try:
              # Get the single item from the filtered queryset
              obj = queryset.get()
          except queryset.model.DoesNotExist:
              raise Http404(_("No %(verbose_name)s found matching the query") %
                            {'verbose_name': queryset.model._meta.verbose_name})
          # 返回查询结果对象
          return obj
      
    8. get_context_object_name()

      def get_context_object_name(self, obj):
          """Get the name to use for the object."""
          if self.context_object_name:
              return self.context_object_name
          elif isinstance(obj, models.Model):
              return obj._meta.model_name
          else:
              return None
      
    9. get_context_data()

      同样有两个类(SingleObjectMixin/ContextMixin)实现了改方法 ,按照MRO,该方法属于SingleObjectMixin

      def get_context_data(self, **kwargs):
          """Insert the single object into the context dict."""
          context = {}
          if self.object:
              context['object'] = self.object
              context_object_name = self.get_context_object_name(self.object)
              if context_object_name:
                  context[context_object_name] = self.object
          context.update(kwargs)
          return super().get_context_data(**context)
      
    10. get()

      def get(self, request, *args, **kwargs):
          self.object = self.get_object()
          context = self.get_context_data(object=self.object)
          return self.render_to_response(context)
      
    11. render_to_response()

      def render_to_response(self, context, **response_kwargs):
          """
          Return a response, using the `response_class` for this view, with a
          template rendered with the given context.
          Pass response_kwargs to the constructor of the response class.
          """
          response_kwargs.setdefault('content_type', self.content_type)
          # response_class = <class 'django.template.response.TemplateResponse'>
          return self.response_class(
              request=self.request,
              template=self.get_template_names(),
              context=context,
              using=self.template_engine,
              **response_kwargs
          )
      

      TemplateResponse: 标准的HttpResponse对象是静态构造的,TemplateResponse对象则是惰性构造的,它保持自己的所有上下文、模板用以构造真正的response,但只有在最后需要的时候才真正进行渲染。
      具体内容可参考此博文 : https://www.cnblogs.com/miyauchi-renge/p/10939240.html


    其他通用类视图资料,请参考官方文档 & Djnago通用类视图详解网站

    如觉有用,来个点赞、关注、收藏呗~
    END!

    展开全文
  • 基于类的通用视图 - 展平索引 ... django.views.generic.detail.DetailView 在执行此视图时,self.object将包含视图正在操作的对象。 此视图从以下视图继承方法和属性: django.views.generic...

    基于类的通用视图 - 展平索引

    通用显示视图
    以下两个通用的基于类的视图旨在显示数据。在许多项目中,它们通常是最常用的视图。

    一、DetailView

           django.views.generic.detail.DetailView
    在执行此视图时,self.object将包含视图正在操作的对象。


    此视图从以下视图继承方法和属性:

    1. django.views.generic.detail.SingleObjectTemplateResponseMixin

    2. django.views.generic.base.TemplateResponseMixin

    3. django.views.generic.detail.BaseDetailView

    4. django.views.generic.detail.SingleObjectMixin

    5. django.views.generic.base.View

    示例myapp / views.py:

    class BlogDetailView(DetailView):
    
        model = Blog
        def get_context_data(self, **kwargs):
            context = super().get_context_data(**kwargs)
            context['date'] = timezone.now()
            blog =Blog.objects.all().first()
            context['title'] = blog.b_title
            context['content'] = blog.b_content
            return context

    示例myapp / urls.py:

    url('blogsdetail/(?P<pk>\d+)/', views.BlogDetailView.as_view(), name='blog-detail'),

    示例myapp / article_detail.html:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
    <h1> 文章详情  </h1>
    
    <p>博客标题: {{ title }}</p>
    <p>博客内容: {{ content }}</p>
    <p>Date: {{ date }}</p>
    </body>
    </html>

    二、ListView

    django.views.generic.list.ListView
    表示对象列表的页面。

    在执行此视图时,self.object_list将包含视图正在操作的对象列表(通常但不一定是查询集)。


    此视图从以下视图继承方法和属性:

    1. django.views.generic.list.MultipleObjectTemplateResponseMixin

    2. django.views.generic.base.TemplateResponseMixin

    3. django.views.generic.list.BaseListView

    4. django.views.generic.list.MultipleObjectMixin

    5. django.views.generic.base.View

    示例views.py:

    class BlogListView(ListView):
        template_name = 'Blogs.html'
        model = Blog
    

    示例myapp / urls.py:

    url(r'^blogs/', views.BlogListView.as_view()),

    示例myapp / article_list.html:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>博客列表</title>
    </head>
    <body>
    
    <h2>今日热门</h2>
    
    <ul>
        {% for blog in blog_list %}
            <li><a href="{% url 'app:blog-detail'  blog.id %}">{{ blog.b_title }}</a>{{ blog.b_content }}</li>
        {% endfor %}
    
    </ul>
    
    </body>
    </html>

     

    如果您正在使用分页,则可以从分页文档中调整示例模板。contacts将该示例模板中的实例更改 为page_obj。

    类django.views.generic.list.BaseListView
    用于显示对象列表的基本视图。它不是直接使用,而是作为django.views.generic.list.ListView表示对象列表的其他视图的父类 。

    此视图从以下视图继承方法和属性:

    django.views.generic.list.MultipleObjectMixin
    django.views.generic.base.View
    方法

    get(请求,* args,** kwargs)
    添加object_list到上下文。如果 allow_empty 为True则显示空列表。如果 allow_empty为False,则引发404错误

    展开全文
  • easyui datagrid-detailview

    热门讨论 2013-06-12 11:39:44
    这个是兼容1.3.1版本的,现在官方1.3.3版本的detailview是不兼容1.3.1的 想要更多easyui的案例解析可以下这个http://download.csdn.net/detail/oushaomeng2011/5480233
  • SingleObjectMixin 主要功能: def get_queryset(self):返回query_set里的所有对象 如果提供的queryset为空且model不为空,返回...DetailView组合SingleObjectTemplateResponseMixin和BaseDetailView实现完整的逻辑处理

    SingleObjectMixin

    主要功能:

    1. def get_queryset(self):返回query_set里的所有对象

      • 如果提供的queryset为空且model不为空,返回self.model._default_manager.all()
      • 提供了queryset,返回self.queryset.all()
    2. get_object(self, queryset=None):根据请求url里的关键字参数pk或者slug过滤query_set来获取单一对象(obj)

      queryset = queryset.filter(pk=pk) 或者 queryset = queryset.filter(**{slug_field: slug})
      obj = queryset.get()
      return obj
      
    3. def get_context_data(self, **kwargs):将对象(obj)其插入到渲染模板所需的上下文中

      self.object = self.get_object
      context['object'] = self.object
      # 或者可以自定义对象名,两者是同时存在的:
      context[context_object_name] = self.object
      
    class SingleObjectMixin(ContextMixin):
        """
        提供了可以操纵检索单一对象的能力
        """
        model = None
        queryset = None
        slug_field = 'slug'
        context_object_name = None
        slug_url_kwarg = 'slug'
        pk_url_kwarg = 'pk'
        query_pk_and_slug = False
    
        def get_object(self, queryset=None):
            # 根据pk和slug查找object
            # 如果自定义了queryset就使用它,这是子类需要的
            # 比如DateDetailView
            if queryset is None:
                queryset = self.get_queryset()
    
            # 接着试着查询pk
            pk = self.kwargs.get(self.pk_url_kwarg)
            slug = self.kwargs.get(self.slug_url_kwarg)
            if pk is not None:
                queryset = queryset.filter(pk=pk)
    
            # 接着试着查询slug
            if slug is not None and (pk is None or self.query_pk_and_slug):
                slug_field = self.get_slug_field()
                queryset = queryset.filter(**{slug_field: slug})
    
            # If none of those are defined, it's an error.
            if pk is None and slug is None:
                raise AttributeError(
                    "Generic detail view %s must be called with either an object "
                    "pk or a slug in the URLconf." % self.__class__.__name__
                )
    
            try:
                # Get the single item from the filtered queryset
                obj = queryset.get()
            except queryset.model.DoesNotExist:
                raise Http404(_("No %(verbose_name)s found matching the query") %
                              {'verbose_name': queryset.model._meta.verbose_name})
            return obj
    
    
        def get_context_data(self, **kwargs):
            """插入单一对象到上下文字典中"""
            context = {}
            if self.object:
                context['object'] = self.object
                context_object_name = self.get_context_object_name(self.object)
                if context_object_name:
                    context[context_object_name] = self.object
            context.update(kwargs)
            return super().get_context_data(**context)
    

    BaseDetailView

    BaseDetailView主要是组合SingleObjectMixinview的各种方法来实现服务器处理一个获取单一对象的get请求的一般流程。

    class BaseDetailView(SingleObjectMixin, View):
        """一个展示单一对象的基本视图"""
        def get(self, request, *args, **kwargs):
            self.object = self.get_object()
            context = self.get_context_data(object=self.object)
            return self.render_to_response(context)
    

    SingleObjectTemplateResponseMixin

    SingleObjectTemplateResponseMixin主要是重写了get_template_names方法,也就是其模板的名字是

    app_label + model_name(小写) + template_name_suffix(_detail)

    class SingleObjectTemplateResponseMixin(TemplateResponseMixin):
        template_name_field = None
        template_name_suffix = '_detail'
    
        def get_template_names(self):
            	# 省略....
                if isinstance(self.object, models.Model):
                    object_meta = self.object._meta
                    names.append("%s/%s%s.html" % (
                        object_meta.app_label,
                        object_meta.model_name,
                        self.template_name_suffix
                    ))
                elif getattr(self, 'model', None) is not None and issubclass(self.model, models.Model):
                    names.append("%s/%s%s.html" % (
                        self.model._meta.app_label,
                        self.model._meta.model_name,
                        self.template_name_suffix
                    ))
    
    
    
            return names
    
    

    DetailView

    class DetailView(SingleObjectTemplateResponseMixin, BaseDetailView):
        """
        Render a "detail" view of an object.
    
        By default this is a model instance looked up from `self.queryset`, but the
        view will support display of *any* object by overriding `self.get_object()`.
        """
    
    

    总结

    1. SingleObjectMixin.get_context_data获取含有单个对象的上下文(context)

    2. SingleObjectTemplateResponseMixin.render_to_response利用上下文进行渲染并返回响应,并重写其

      get_template_names方法

    3. BaseDetailView组合SingleObjectMixin和View并实现get请求和分发

    4. DetailView组合SingleObjectTemplateResponseMixinBaseDetailView实现完整的逻辑处理

    展开全文
  • easyui datagrid 各种视图view
  • detailview

    2017-08-28 10:53:40
    一、easyui 的 detailview又叫subgrid其实也就类似于分组表格的意思,先见效果图 二、下面说下使用方法 1.页面引入样式 2.引入脚本 JavaScript" src="js/jQuery-1.8.3.js"> javascript" ...

    一、easyui 的 detailview又叫subgrid其实也就类似于分组表格的意思,先见效果图


    二、下面说下使用方法

    1.页面引入样式

    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">

    2.引入脚本

    <script type="text/JavaScript" src="js/jQuery-1.8.3.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="easyui/datagrid-detailview.js"></script>
    <script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js"></script>

    detailview.js官网下载的包应该没有,不过也很好获得,我们在看在线demo的时候可以看到detailview的路径,然后下载下来,这里就直接贴出了方便大家下载http://www.jeasyui.com/easyui/datagrid-detailview.js


    3.脚本写法

    [html]  view plain  copy
    1. <!-- 查询结果显示 -->  
    2.  <table id="acquisitionTab"></table>  


    [html]  view plain  copy
    1. $('#acquisitionTab').datagrid({  
    2.             view: detailview,//注意1  
    3.             title: '我的取数',  
    4.             url:'../json/queryAcquisitionList.action',  
    5.             fitColumns: true,  
    6.             singleSelect:true,  
    7.             height: 340,  
    8.             pagination: true,  
    9.             columns: [  
    10.                 [  
    11.                     {field: 'id', checkbox: true },  
    12.                     {field: 'code', title: '任务编号'},  
    13.                     {field: 'templateName', title: '主 题',width:50},  
    14.                     {field: 'topic', title: '取数目的',width:50}}  
    15.                 ]  
    16.             ],  
    17.             detailFormatter:function(index,row){//注意2  
    18.                 return '<div style="padding:2px"><table id="ddv-' + index + '"></table></div>';  
    19.             },  
    20.             onExpandRow:function(index,row){//注意3  
    21.                 $('#ddv-'+index).datagrid({  
    22.                     url:'../statisticJson/getStatisticTaskByAcqu.action?idapStatisticTask.taskGroupId='+(row.id),  
    23.                     fitColumns:true,  
    24.                     singleSelect:true,  
    25.                     height:'auto',  
    26.                     columns:[[  
    27.                         {field:'taskId',title:'统计任务ID'},  
    28.                         {field:'taskName',title:'任务名称',width:50},  
    29.                         {field:'taskStatue',title:'任务状态',formatter:function(value, row, index){  
    30.                             if (value) {  
    31.                                 switch (value) {  
    32.                                     case '0':  
    33.                                         return '任务创建';  
    34.                                         break;  
    35.                                     case '1':  
    36.                                         return '待执行';  
    37.                                         break;  
    38.                                     case '2':  
    39.                                         return '执行中';  
    40.                                         break;  
    41.                                     case '3':  
    42.                                         return '执行成功';  
    43.                                         break;  
    44.                                     case '4':  
    45.                                         return '执行失败';  
    46.                                         break;  
    47.                                     case '-1':  
    48.                                         return '任务取消';  
    49.                                         break;  
    50.                                     default :  
    51.                                         return '已删除';  
    52.                                         break;  
    53.                                 }  
    54.                             }  
    55.                         }},  
    56.                         {field:'taskType',title:'任务说明',width:100},  
    57.                         {field:'statisticOpera',title:'任务操作',width:50,align:'center',  
    58.                             formatter:function(value, row, index){  
    59.                                 if(row.taskStatue != '-2'){  
    60.                                     var tdContext = '<a href="#this" οnclick="removeStatistic('+(row.taskId)+')">删除</a>  ';  
    61.                                 }  
    62.                                 return tdContext;  
    63.                         }}  
    64.                     ]],  
    65.                     onResize:function(){  
    66.                         $('#acquisitionTab').datagrid('fixDetailRowHeight',index);  
    67.                     },  
    68.                     onLoadSuccess:function(){  
    69.                         setTimeout(function(){  
    70.                             $('#acquisitionTab').datagrid('fixDetailRowHeight',index);  
    71.                         },0);  
    72.                     }  
    73.                 });  
    74.                 $('#acquisitionTab').datagrid('fixDetailRowHeight',index);  
    75.             }  
    76.   
    77.         });  


    上述3点注意就是较基本datagride的写法上加的内容


    三、说下注意事项

    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">

    该样式表主要是一些图标的样式,笔者在使用中发现,若引入该样式在detailview下,父表无法获取选中,去掉则恢复正常,不知道其他朋友有没有遇到相关的情况,我这边就是暂时采用这样的处理方式


    展开全文
  • datagrid-detailview 使用总结 具体的使用方法大家可以参考下边这篇博文,个人感觉使用方法总结的还是比较好的,本人也比较懒,就不做重复工作了。 ... 本片博客只总结再使用过程中遇到的问题和解决方法。...
  • bootstrap table detailView

    千次阅读 2016-11-22 10:43:32
    最近在研究bootstrap table的使用,过程中查询了许多资料,在给table做点击下拉详情时发现网上的资料大部分是基础应用的资料,只有很少的一部分关于这部分的资料,而且并不完全。...detailView:true, d...
  • <p>I tried doing this on the <code>DetailView::widget()</code>: <pre class="lang-php prettyprint-override"><code>... [ 'attribute'=>'image', 'value'=>('/frontend/web/uploads/'.$model->...
  • easyui使用detailview创建子网格数据

    千次阅读 2018-10-17 10:28:25
    效果图(网上copy的图片,使用方法请关注下方): 使用方法: html页面除了基本的css和js外,创建分组子网格还需引入下方js,请自行下载。 ...../../easyui/datagrid-detailview.js&amp;amp;amp
  • DetailView django.views.generic.detail.DetailView 在执行此视图时,self.object将包含该视图所操作的对象。 该视图从以下视图继承方法和属性: django.views.generic.detail.SingleObjectTemplateResponseMixin ...
  • datagrid-detailview.js下载 效果图: Ajax function InOutOK() { //退社_变更完成 tab = $('#dataTable').datagrid({ width: '100%', singleSelect: true, pageSize: 10, collapsible: true, url: '...
  • easyui detailview 展开一行,关闭其他行 1、定义全局变量var defviewIndex=undefined ; 2、在onExpandRow: function(index,row)中增加如下内容: if(defviewIndex!= undefined && defviewIndex!= index)...
  • Django的DetailView的使用

    2020-07-24 17:35:00
    class PostDetailView(CommonViewMixin, DetailView): queryset = Post.latest_posts() template_name = 'blog/detail.html' context_object_name = 'post' pk_url_kwarg = 'post_id' def get(self, request, ...
  • 接下来我就大概说一下类视图中ListView和DetailView的使用方法 ListView 通常我们会在博客首页的视图函数里这样写 from .models import Article # 引入博文类 def index(request): # 从数据库中取出博文并按发表时间...
  • Django通用显示视图DetailView与ListView

    千次阅读 2018-10-16 17:22:07
    基于类的通用视图 - 展平索引 ... django.views.generic.detail.DetailView 在执行此视图时,self.object将包含视图正在操作的对象。 此视图从以下视图继承方法和属性: django.views.generic....
  • 最近用到了bootstrap table 详细视图,展示字数比较多的字段,经过在网上查找,使用detailView实现,只需要做以下配置。 detailView:true, detailFormatter:function(index,row){ return row.content; } 效果如...
  • 比较如下:

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 3,955
精华内容 1,582
关键字:

detailview