EasyUI Forum
April 20, 2024, 12:54:48 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: 1 ... 12 13 [14] 15
196  General Category / EasyUI for jQuery / "Card view" editing on: September 05, 2013, 12:11:11 PM
is there any example of editing in card view?  I don't see code for the datagrid in the src folder, and the code in the plugins folder is also obfuscated and hard to follow.  I don't really see an equivalent to renderRow for the row editor.  I do see how I might make new cell editors, just not for replacing the whole row.
197  General Category / EasyUI for jQuery / Re: required fields in datagrid? on: September 05, 2013, 12:03:45 PM
yeah I should have seen that.  thanks.
198  General Category / EasyUI for jQuery / required fields in datagrid? on: September 04, 2013, 10:40:21 AM
I have grid editing working based on the "Row Editing in DataGrid" example.  in the example there's a combobox that's marked Required and I have that working.  I'm trying to make a text box required also, and this isn't doing it.
Code:
<th data-options="field:'F1',width:155,
editor:{
type:'text',
options:{
required:true
}
}">field 1</th>

I also tried this:
Code:
<th data-options="field:'F1',width:155,editor:'text',required:true">Field 1</th>
199  General Category / General Discussion / Re: javascript in ajax loaded panel on: September 04, 2013, 10:30:50 AM
so it turns out that it's the .form('submit') that does this, and is causing other problems for me as well.  my work around is to send the form data via $.ajax in the onSubmit: and then return false letting the ajax success handle loading the content..
200  General Category / General Discussion / Re: javascript in ajax loaded panel on: August 30, 2013, 08:31:20 AM
I just noticed something in Chrome's inspector.

I'm getting iframes with my contentdata in them with id's like "easyui_frame_1377876179527".  if I make the javascript so that it generates a fatal error, the iframe is left there and I can see it.

is .panel({ content: contentdata } ) loading the content into an iframe, then copying it into the document, then removing the iframe?  that's this looks like.  and if so, that's why $(function() {}) isn't working.  the iframe doesn't have the the script tags to load jquery and that's why I'm getting errors. 

in my previous framework my content loader used jquery's $.ajax() and did not have this problem.
201  General Category / EasyUI for jQuery / Re: validatebox, adding a new rule on: August 23, 2013, 06:27:11 AM
this is because if the value is selected and deleted, the validation won't fire since it doesn't run when the value is blank?  would it be a bad thing to run validation functions on blank values anyway?
202  General Category / EasyUI for jQuery / Re: form onsubmit (param) clarification on: August 23, 2013, 06:24:37 AM
when I do param.text_box_name I get undefined.
203  General Category / EasyUI for jQuery / validatebox, adding a new rule on: August 22, 2013, 02:09:36 PM
I'm looking for a cleaner way to do this:
Code:
<script>
$.extend($.fn.validatebox.defaults.rules, {
pickonemore: {
validator: function(value,param){
var hasone = false;
$(param).each(function(k,p) {
if ($(p).val() != "") hasone = true;
});
if(hasone) {
$(param).each(function(k,p) {
$(p).validatebox('disableValidation');
});
} else {
$(param).each(function(k,p) {
$(p).validatebox('enableValidation');
});
}
return hasone;
},
message: 'Enter at least one value in this group.'
}
});
</script>
<input id="box1" class="easyui-validatebox" type="text" name="box1" required="required" validType="pickonemore['#box1','#box2','#box3']"></input></td>
<input id="box2" class="easyui-validatebox" type="text" name="box2" required="required" validType="pickonemore['#box1','#box2','#box3']"></input></td>
<input id="box3" class="easyui-validatebox" type="text" name="box3" required="required" validType="pickonemore['#box1','#box2','#box3']"></input></td>

goal is to require one or more of the 3 values to be entered.  I'm using enableValidation/disableValidation calls because my new validator does not seemed to be called when a box is blank.  is there a better way?
204  General Category / EasyUI for jQuery / form onsubmit (param) clarification on: August 22, 2013, 01:10:10 PM
when using "onSubmit: function(param){" is param supposed to be pre-filled with the form data?  the documentation doesn't say either way.
205  General Category / General Discussion / Re: javascript in ajax loaded panel on: August 22, 2013, 12:05:41 PM
so this works:

Code:
var contentdata = '<div><form><select id="foo" class="easyui-combobox"><option value="x1">x1</option><option value="x">x</option></select></form></div>'
+ '<script>'
+ 'function content_onload() {'
+ '  $("#foo").combobox().combobox("select", "x");'
+ '}'
+ '<\/script>';
var centerpanel  = $('#mainlayout').layout('panel','center');
centerpanel.panel({content:contentdata});
content_onload();

has to be some sort of timing issue.  maybe only related to Chrome, I haven't tested other browsers yet.
206  General Category / General Discussion / Re: javascript in ajax loaded panel on: August 22, 2013, 06:23:37 AM
hm.  this is certainly a lot simpler than my actual code.  I may try a redesign (i'm still very early in the process), then I'll make a mock up in a pubic place if I still have the issue.
207  General Category / General Discussion / Re: javascript in ajax loaded panel on: August 21, 2013, 07:15:38 PM
a string that contains mixed html and javascript sniplet, such as
Code:
<div><form><select id="foo" class="easyui-combobox">...</select></form></div>
<script>
$(function() {
  $('#foo').combobox('select', 'x');
});
</script>

no matter what the javascript is, if it uses jquery, I get the error the 2nd+ times contentdata is loaded in, but not the first time, even if is the exact same content.
208  General Category / General Discussion / Re: Chain Combo Inline editor (2) on: August 21, 2013, 02:01:24 PM
you might find the linked example in the documentation more clear.  it also shows the json format expected.  http://www.jeasyui.com/documentation/index.php#
209  General Category / General Discussion / javascript in ajax loaded panel on: August 21, 2013, 01:59:34 PM
I've got an ajax handler that validates a result and does this:
Code:
centerpanel = $('#mainlayout').layout('panel', 'center');
centerpanel.panel({ content: contentdata } );

contentdata sometimes has javascript in it, using $(function(){...}); to do some modifications to forms and such.  the first one like this loads and works correctly, the 2nd one causes the "$(function()" line to generate "Uncaught ReferenceError: $ is not defined" errors.  javascript functions in the same script block will still work though, it just doesn't like the initial jquery stuff. 

I've even tried modifying the code, the first $( always works, the 2nd+ always error, no matter what the code is.

I've done this before using jquery's .html() and the code always runs fun, but doing .html(contentdata); to a panel seems to turn the panel into a plain div.

is there a better way to handle the javascript blocks, or something I need to do to bless them?
210  General Category / Bug Report / Re: feature request: combobox defaults on: August 19, 2013, 02:05:13 PM
I understand how to override it.  I think it would benefit the project in general to make this the default behavior.
Pages: 1 ... 12 13 [14] 15
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!