Limit a Dataview

  1. #1

    Limit a Dataview

    Hello,

    I've got a fileuploadfield with a DataView for photos.
    Can i limit the dataview to allow only add five photos?

    How can i get it?

    Thanks.
  2. #2
    Hi,

    Just checking the store count
    store.getCount()
    if count >= 5 then disable UI controls which respondible for photos adding
  3. #3
    Hello Vladimir,

    I´ve got a fileuploadfield like this:
    <ext:FileUploadField ID="myfileUpload" runat="server" FieldLabel="Photo"
    Width="200" Icon="Attach" ButtonText="Browser" Validator="checkFile">
    function checkFile(value)
    {
    if (value.match("\.jpg$") != null || value.match("\.jpeg$") != null)
    {return true;}
    else
    {return "Invalid Format";}
    }
    How can i add your code to this to check store count?

    Thanks.
  4. #4
    Hi,

    Please provide test sample which demonstrates scenario
  5. #5
    Quote Originally Posted by walle View Post
    Hello Vladimir,

    I´ve got a fileuploadfield like this:
    <ext:FileUploadField ID="myfileUpload" runat="server" FieldLabel="Photo"
    Width="200" Icon="Attach" ButtonText="Browser" Validator="checkFile">
    function checkFile(value)
    {
    if (value.match("\.jpg$") != null || value.match("\.jpeg$") != null)
    {return true;}
    else
    {return "Invalid Format";}
    }
    How can i add your code to this to check store count?

    Thanks.
    Just add something like

    if (YourStoreName.getCount()) > 5) {return "Max count exceeded or whatever you want message";}
    to your CheckFile function
  6. #6
    Hello jchau,

    Your solution works fine.

    You can mark as CLOSED.

    Thanks a lot.
    Last edited by walle; Jul 20, 2010 at 10:47 AM.

Similar Threads

  1. Characters limit in TextField
    By flaviodamaia in forum 1.x Help
    Replies: 2
    Last Post: May 25, 2012, 2:30 AM
  2. [CLOSED] DataView to DataView Drag and Drop
    By paulc in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 10, 2012, 8:19 PM
  3. Limit of a Multiselect
    By ddolan in forum 1.x Help
    Replies: 0
    Last Post: Jun 02, 2011, 8:45 PM
  4. FileUploadField has limit ???
    By Puia in forum 1.x Help
    Replies: 3
    Last Post: Mar 01, 2010, 4:02 PM
  5. Limit panel resize?
    By dbassett74 in forum 1.x Help
    Replies: 3
    Last Post: May 11, 2009, 4:28 PM

Posting Permissions