Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3607758
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:24:59+00:00 2026-05-18T21:24:59+00:00

I was able to successfully render my first django form inside an extjs tab.

  • 0

I was able to successfully render my first django form inside an extjs tab. The form data displayed properly and the form validation appears to be working properly.

My problem is that django wants to render the whole new page, not just push the results back into the same tab. I think my app will function better if I can keep all this inside a single tab without complete page rendering.

Background: I used the EXTJS ajax tab example to get this working. Then only problem is that the example didn’t have multiple get/post calls getting rendered into the same tab, so I’m not sure how to do that.

Question: How do I keep the results of the POST data inside the EXTJS tab? Also, from experts who develop a lot of these apps, am I using the correct pattern here?

Here’s my basic layout:

File: grid.js – Builds an EXTJS grid, user clicks ‘edit’ icon which does a call to django to grab the edit form.

  var createColModel = function (finish, start) {

  var columns = [{
      dataIndex: 'pk',
      header: 'Student ID',
      filterable: true
      //,filter: {type: 'numeric'}
  }, {
   // ... More column data here
  },{
      header: 'Actions',
      id: 'actions',
      xtype: 'actioncolumn',
      width: 50,
      items: [{
           icon   : '/site_media/icons/application_edit.png',  
           tooltip: 'Edit Record',
           handler: function(grid, rowIndex, colIndex) {
               var rec = studentStore.getAt(rowIndex);
               mainTabPnl.add({
                   title: rec.get('fields.first_name') + ', ' + rec.get('fields.last_name'),
                   iconCls: 'tabs',
                   autoLoad: {url: '/app/edit_student/' + rec.get('pk')}, 
                   closable:true
               }).show();
           }
       }]
  }];

File: views.py

 def edit_student_view(request, sid):
   print "Edit Student: " + sid
   student = Student.objects.get(pk=sid)
   if request.method == 'POST': 
     form = StudentProfileForm(request.POST, instance=student) 
     if form.is_valid(): 
       student=form.save() 
       message="Edit successful"
       c = {'form' : form, 'student':student, 'message':message}
       return render_to_response('app/edit_student.html', c, context_instance=RequestContext(request)) 
     else:
       message = "The form contains errors."
       c = {'form':form, 'student':student, 'message':message}
       // Problem: This is now rendered as the whole page, not inside the tab
       return render_to_response('app/edit_student.html', c, context_instance=RequestContext(request)) 
   else:
     form = StudentProfileForm(instance=student) 
     c = {'form':form, 'student':student}
   //Initial GET: renders in correct EXTJS window.
   return render_to_response('app/edit_student.html', c, context_instance=RequestContext(request)) 

File: edit_student.html – renders the django form

 {% block mainpanel %}

 {% if form.errors %}
   <p>The Registration form had errors. Please try again.</p>
 {% endif %}

 {% if form %}
 <form action="/app/edit_student/{{student.student_id}}/" method="post">
    <table>
    {{ form.as_table }}
   </table>
   <input type="submit" value="Submit" />
 </form>
 {%endif%}

 {% endblock %}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:25:00+00:00Added an answer on May 18, 2026 at 9:25 pm

    If you want to keep it within the tab then you’ll need to forgo the standard HTML form mechanisms and instead set the onclick event on a button to perform a POST via AJAX.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HBITMAP containing alpha channel data. I can successfully render this using
I am successfully able to receive push notification on my device which is of
I am successfully able to authenticate Facebook and Google accounts using my Oauth2 servlets.
I'm able to successfully set the options for my select list but the selected
I was able to successfully run an RF model using some R code I
I was able to successfully configure and generate the build folder (KinectSLAM6D/build.). However, when
I am able to successfully call a function with ctypes in Python. I now
Hi I'm able to successfully integrate iphone app with facebook framework. But I need
I am able to successfully execute this on windows: builder = new ProcessBuilder(cmd.exe, /c,
I've been able to successfully play with the touchstart, touchmove, and touchend events on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.